substorm Posted October 11, 2007 Share Posted October 11, 2007 Hi, I am new to AutoIT and I still have lots to learn. While doing some tutorials, I have come to an issue where another window popped up and the script didn't know what to do. Is there a way to prevent this? Link to comment Share on other sites More sharing options...
Generator Posted October 11, 2007 Share Posted October 11, 2007 WinSetOnTop ( "title", "text", flag ) Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 11, 2007 Share Posted October 11, 2007 Hi,I am new to AutoIT and I still have lots to learn. While doing some tutorials, I have come to an issue where another window popped up and the script didn't know what to do. Is there a way to prevent this?The problem with WinSetOnTop is that the window that is on top is not necessarily active, it just doesn't get graphically overwritten by the window that is active. If other processes might take focus away, and for more reliable functionality anyway, use the Control* functions, like ControlSend() vice Send(), and ControlClick(), because they specify the window to act on. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
substorm Posted October 13, 2007 Author Share Posted October 13, 2007 Thanks for your quick replies. So, I would be safest to use the "Control" functions in order to avoid other windows stealing focus? If it wouldn't be a big problem, could someone post some installation script that uses such conrols? BTW, is there some place that hosts installation scripts for most common applications? I checked out the Script section on this forum but couldn't find much. Link to comment Share on other sites More sharing options...
Bert Posted October 13, 2007 Share Posted October 13, 2007 well....It is easier said than done. Have you tried using the macro recorder? The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
LarryDalooza Posted October 13, 2007 Share Posted October 13, 2007 Send("#r") WinWait("Run") Sleep(200) Run("mspaint") ToolTip("Wait for it") Sleep(3000) ToolTip("") ControlSetText("Run","","Edit1","") ControlSend("Run","","Edit1","calc") ControlClick("Run","","OK") AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
substorm Posted October 13, 2007 Author Share Posted October 13, 2007 well....It is easier said than done. Have you tried using the macro recorder? Is this some extra plugin for AutoIT? I didn't see any info on this in the tutorial. Where would I find it? Send("#r") WinWait("Run") Sleep(200) Run("mspaint") ToolTip("Wait for it") Sleep(3000) ToolTip("") ControlSetText("Run","","Edit1","") ControlSend("Run","","Edit1","calc") ControlClick("Run","","OK") Cool. Even if another window has focus, your script still works. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2007 Moderators Share Posted October 13, 2007 Is this some extra plugin for AutoIT? I didn't see any info on this in the tutorial. Where would I find it?Cool. Even if another window has focus, your script still works.Control* functions generally will work on any windows "controls" in whatever state (Minimized however sometimes won't work).They are listed under Control* Functions in your index of the help file.To find the controls, you can use the AutoInfo.exe tool, as you move your mouse over a control, and have the control tab open in the info.exe tool, you'll see the Control ID, ClassNameNN and Instance.You can use the Control ID itself (sometimes they change though), or the ClassNameNN + Instance in autoit to achieve control manipulation. 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...
Valuater Posted October 13, 2007 Share Posted October 13, 2007 I didn't see any info on this in the tutorial. Where would I find it? There is a great demo in "Welcome to Autoit 1-2-3"in my sig below8) 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