Kashgari Posted September 24, 2009 Posted September 24, 2009 Hi, I have not seen any thing in regard with this, but I believe it should be possible. I am using a script on Firefox to automate some task but I also want to do some other work with firefox, but the script takes away active firefox window, I have tried to use different tab, or opening new firefox windows, but the script just launches on active window that I am using. What is the solution? I want to attach or assign a script to particular tab or firefox window. Thanks.
sias Posted September 24, 2009 Posted September 24, 2009 Have you looked into the FireFox UDF by StilGar?_FF UDF "The true measure of a man is how he treats someone who can do him absolutely no good."
Stilgar Posted September 24, 2009 Posted September 24, 2009 (edited) On 9/24/2009 at 9:25 PM, 'Kashgari said: Hi, I have not seen any thing in regard with this, but I believe it should be possible.I am using a script on Firefox to automate some task but I also want to do some other work with firefox, but the script takes away active firefox window, I have tried to use different tab, or opening new firefox windows, but the script just launches on active window that I am using. What is the solution? I want to attach or assign a script to particular tab or firefox window.Thanks.Takes the running script your active FireFox window?Normaly not. _FFConnect uses the last opened FF-window.You can assign the script to a window with _FFWindowSelect, but not to a tab.Or you can made a connection to FF and open a new window for your script with _FFWindowOpen, or with _FFStart.If you wanna work with FireFox while your script is running, just use another window. Edited September 24, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
Kashgari Posted September 24, 2009 Author Posted September 24, 2009 On 9/24/2009 at 9:46 PM, 'Stilgar said: Takes the running script your active FireFox window?Normaly not. _FFConnect uses the last opened FF-window.You can assign the script to a window with _FFWindowSelect, but not to a tab.Or you can made a connection to FF and open a new window for your script with _FFWindowOpen, or with _FFStart.If you wanna work with FireFox while your script is running, just use another window.You are right, after posting the topic I found out script takes last opened FF-window, including all its tabs, but I can just open another window. What happened is I have created a loop with two script which calls one after another, in this way I can not use firefox any windows as the loop keeps taking the new window, now I have created a loop in single script so problem solved._FFWindowOpen sounds a good way, I will spend some time learning it.Thanks Stilgar, for your fast responce.
Kashgari Posted September 25, 2009 Author Posted September 25, 2009 (edited) @ StilGar Strange things happening. I am using following script which should be attached to Firefox, as you said to last windows, now it is again "running out of the fence", it now only fox various windows of firefox it also executes on other browser as well as text editing software. This is the code: #include <file.au3> #Include <FF.au3> Dim $aRecords If Not _FileReadToArray("L:\recent.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf _FFConnect() If _FFIsConnected() Then For $x = 1 to $aRecords[0] _FFOpenUrl($aRecords[$x]) Sleep(11000) _FFLinkClick("Add to groups", "text") Sleep(2000) For $count = 1 To 19 Send("{TAB}") Next Send("{SPACE}") Send("{TAB}") Send("{ENTER}") Sleep(9000) Next EndIf This is weird! Edited September 25, 2009 by Kashgari
Stilgar Posted September 25, 2009 Posted September 25, 2009 (edited) On 9/25/2009 at 12:03 AM, 'Kashgari said: @ StilGar Strange things happening. I am using following script which should be attached to Firefox, as you said to last windows, now it is again "running out of the fence", it now only fox various windows of firefox it also executes on other browser as well as text editing software. This is the code: ... This is weird! That isn't weird This lines: For $count = 1 To 19 Send("{TAB}") Next Send("{SPACE}") Send("{TAB}") Send("{ENTER}") are working on the active window not explicit on the FireFox window. What are you doing with this Send commands in FireFox? Is think there would be a better solution. Edited September 25, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
Kashgari Posted September 25, 2009 Author Posted September 25, 2009 You are right the script has some problem for now. let me explain. when I do this : _FFLinkClick("Add to groups", "text") all available check boxes will be dropped, I want to select the 19th, I can use _ffcheckbox to select 19th checkbox, but that check box need a click as there are 3 further dropdown options available within this checkbox, these three options is visible only when I click it (maybe some hidden javascript, or ajax,) not with _ffcheckbox. So when script is running I can not do anything on my computer. I have to either find out ways to utilize ffclick after finding out more about the structure of the webpage, or find a way to bound this script with particular firefox instance which I do not know how. thanks for your continues help.
Stilgar Posted September 28, 2009 Posted September 28, 2009 On 9/25/2009 at 2:22 PM, 'Kashgari said: when I do this : _FFLinkClick("Add to groups", "text") all available check boxes will be dropped, I want to select the 19th, I can use _ffcheckbox to select 19th checkbox, but that check box need a click as there are 3 further dropdown options available within this checkbox, these three options is visible only when I click it (maybe some hidden javascript, or ajax,) not with _ffcheckbox.At the moment you can simulate onchange (...) events with the function _FFDispatchEvent.In the future they will be automaticly simulated by the _FFForm* functions.19 checkboxes? Or is this an option-select? jEdit4AutoIt PlanMaker_UDF
PaulMorris Posted May 3, 2011 Posted May 3, 2011 It was interesting to come across this thread. I was hoping to run two (or more) Firefox instances simultaneously using FF.au3 but without much success. I am launching each Firefox instance with a separate MozRepl port number (and with the -no-remote flag) but I am not able to successfully control the separate Firefox browsers using _FFconnect. I had hoped that simultaneous, independent operation of multiple Firefox browser sessions was possible, has anyone been able to do this? Much thanks for any advice
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