norelidd Posted October 14, 2007 Share Posted October 14, 2007 I am trying to get a script written up to help out with some common things I do. I am trying to send a URL to firefox, or better yet, I want to input text to the Address Bar as I am using the Firefox Keyword Search feature, which relies on the text being entered in the address bar or the CTRL+L "Open Location" menu. The thing is, activating Firefox and using keyboard commands to open a new tab (^T), then enter text and paste something in and hit enter is a little clunky and cumbersome. Is there another way to do this? Additionally, if I swtich windows while the script is still running, it will dump the keystrokes into whatever window I swtiched to, which is logical, but annoying. Can the Firefox window be locked in activation while the script runs, or perhaps the commands be sent behind the scenes to not need keyboard macros? Also, another problem I'm having is activating the correct FF window. I will sometimes have little popup windows active for various tasks, but if the script activates those windows, it will fail, since it has no address bar to paste the text into. Can WinActivate differentiate between a FireFox instance that has tabs and an address bar, and one that doesn't? Thanks for the help! Link to comment Share on other sites More sharing options...
Nahuel Posted October 14, 2007 Share Posted October 14, 2007 I've never tried with Firefox.. but I suppose it should work: Go to the AutoIt Window Info tool and search firefox's controls. Then look in help file for ControlClick, ontrolSetText, ControlGetText, etc... Link to comment Share on other sites More sharing options...
norelidd Posted October 14, 2007 Author Share Posted October 14, 2007 I tried that, but all windows seem to have the same properties. Is there a way to conditionally activate a window based on some control properties? Link to comment Share on other sites More sharing options...
Nahuel Posted October 14, 2007 Share Posted October 14, 2007 (edited) Something like this maybe? Run("mspaint") WinWaitActive("[CLASS:MSPaintApp]") While 1 If BitAND(Wingetstate("[CLASS:MSPaintApp]"),8)=8 Then ToolTip("Paint is active",0,0,"Window State") Else ToolTip("Paint is NOT active - Activating",0,0,"Window State") WinActivate("[CLASS:MSPaintApp]") EndIf Sleep(25) If BitAND(Wingetstate("[CLASS:MSPaintApp]"),2)<>2 then Exit WEnd Oh... and I think you could make it work with more than one window. Just work with their handles. Edited October 14, 2007 by Nahuel Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 14, 2007 Moderators Share Posted October 14, 2007 These are all the controls mine had:MozillaWindowClass1MozillaWindowClass2MozillaWindowClass3MozillaWindowClass4MozillaWindowClass5MozillaWindowClass6MozillaWindowClass7MozillaWindowClass8MozillaWindowClass9MozillaWindowClass10MozillaWindowClass11MozillaWindowClass12MozillaWindowClass13MozillaWindowClass14MozillaWindowClass15MozillaWindowClass16MozillaWindowClass17MozillaWindowClass18MozillaWindowClass19MozillaWindowClass20MozillaWindowClass21MozillaWindowClass22MozillaWindowClass23MozillaWindowClass24MozillaWindowClass25MozillaWindowClass26MozillaWindowClass27MozillaWindowClass28MozillaWindowClass29MozillaWindowClass30MozillaWindowClass31MozillaWindowClass32MozillaWindowClass33MozillaWindowClass34MozillaWindowClass35MozillaWindowClass36MozillaWindowClass37MozillaWindowClass38MozillaWindowClass39MozillaWindowClass40MozillaWindowClass41MozillaWindowClass42MozillaWindowClass43MozillaWindowClass44MozillaWindowClass45MozillaWindowClass46MozillaWindowClass47MozillaWindowClass48MozillaWindowClass49MozillaWindowClass50MozillaWindowClass51MozillaWindowClass52MozillaWindowClass53MozillaContentWindowClass1MozillaContentWindowClass2MozillaContentWindowClass3MozillaContentWindowClass4MozillaContentWindowClass5MozillaContentWindowClass6MozillaContentWindowClass7MozillaContentWindowClass8MozillaContentFrameWindowClass1MozillaContentFrameWindowClass2MozillaContentFrameWindowClass3 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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