XanzyX Posted June 6, 2016 Share Posted June 6, 2016 Hey guys. I need some help. I have a client that wants to automate postings on Facebook via the "Quick Share" botton on Google Chrome. For the life of me I can't get AutoIT to recognise that button. I used au3ibfo to get the following information about that button. Class: Chrome_WidgetWin_1 Handle: 0x00000000000F071A ive tried to use ControlClick but it does not seem to work. https://chrome.google.com/webstore/detail/facebook-quick-share/gccankbfoldbmopamiokjlnnafnoiadd?hl=en Link to comment Share on other sites More sharing options...
Valzul Posted June 8, 2016 Share Posted June 8, 2016 Hi XanzyX, I've been searching a way to solve your problem, and this is what I came up with ( it is more of a "on-the-fly" way to do it than a real program ) : 1) Set an Hotkey for this particular extension on Chrome : Go to the extensions settings by doing this for example : Click on the at the top left of Chrome window ( I apologize in advance for this, but I'm french, my Chrome is french, so the translation might not be that good ) More tools > Extensions On the bottom of the page, you should see something like "Keyboard hotkeys" link Configure the Facebook Quick Share to use a particular combinaison of keys which you have defined ( Ctrl + P in my case ) Validate by clicking "O.K" 2) AutoIT Script Now what you want AutoIT to do is : To put the Google Chrome window in focus. To send the defined hotkey for Facebook Quick Share To execute a combinaison of keys that will allow to click on the "Like" button Here is my try at it : expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Paul BIGEON Script Function: This particular script is written for XanzyX 1. Put Google Chrome to front 2. Execute a macro to use Facebook Quick Share : Like feature on the fly #ce ---------------------------------------------------------------------------- ; Sendkey delay set to 50 to be sure that keys are well sent. Opt("SendKeyDelay",50) ; Hotkey attribution : ; We want this hotkey to be something different than those used by the system, as Ctrl + Z or Alt + F4 ; for example. ; Here we use Ctrl + M, thus launching the FQS_LikeMacro() function. HotKeySet("^m","FQS_LikeMacro") Func FQS_LikeMacro() Dim $Hndl ; 1 First, get the handle of Chrome Legacy Window and set focus ... $Hndl = WinGetHandle("[CLASS:Chrome_WidgetWin_1]","Chrome Legacy Window") WinActivate($Hndl,"Chrome Legacy Window") ; 2 Send the defined hotkey on Chrome ; Here I used Ctrl + P Send("^p") ; Wait for the control to pop, or else the next sequence will play on the window itself Sleep(1250) ; 3 Send the keys that allow the navigation into the FQS control to click on the "Like" button Send("{TAB}{TAB}{TAB}") Send("{ENTER}") EndFunc While 1 Sleep(100) WEnd Again, this is a very messy way of doing it, and it requires that the user don't do anything for 4 or 5 sec or so ... Well, hope it can be of use as a start idea ... Valzul. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now