flat5 Posted August 25, 2004 Share Posted August 25, 2004 I want to automate windows that I select by clicking on them. I can't figure out how to do this. The window title text is not known ahead of time. Is there a way to do this? Thanks. Link to comment Share on other sites More sharing options...
flat5 Posted August 25, 2004 Author Share Posted August 25, 2004 to get the currently active window's title... $szTitle = WinGetTitle("") Lar. <{POST_SNAPBACK}>I know about that, but I don't see how it solves the problem. How would I pause and then resume the script such that the WinGetTitle("") would grab the just activated window? Thanks. Link to comment Share on other sites More sharing options...
ezzetabi Posted August 25, 2004 Share Posted August 25, 2004 (edited) Maybe you should check every second or so what is the active window and if it is one where you want to automate something start the relative code. E.g. While 1 $SZTITLE = WinGetTitle("") Select Case $SZTITLE = "My first program" ;Do what I want on My first program Case $SZTITLE = "My second program" ;Do what I want on My second program Case Else Sleep(1000) EndSelect Wend @Larry... What is the meaning of this strange SZ ? it werent easier just say $Title? Edited August 25, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Valik Posted August 25, 2004 Share Posted August 25, 2004 sz is a common programmers prefix which means the variable contains a string. Link to comment Share on other sites More sharing options...
flat5 Posted August 26, 2004 Author Share Posted August 26, 2004 I admit, I don't have a handle on what you want to do. If you describe it with more detail I may be able to help. I am grasping at straws with my responses. LAr. <{POST_SNAPBACK}>I want to start a script, and have it prompt me for the window I want to automate. I respond by clicking in the window, and it carries on and works with that window. Link to comment Share on other sites More sharing options...
ezzetabi Posted August 26, 2004 Share Posted August 26, 2004 sz is a common programmers prefix which means the variable contains a string. <{POST_SNAPBACK}> But... AFAIK all vars in Autoit are Variant and so can keep every kind of data... What is the meaning? (Sorry for the out-topic, but I am interested) Link to comment Share on other sites More sharing options...
Valik Posted August 26, 2004 Share Posted August 26, 2004 It means exactly what I said. Its a hint to the programmer that the variable with that prefix with be a string. It has nothing to do with the actual implementation of the datatype or that the datatype in theory can hold numbers or whatever. Its along the same lines of why you might name a function after what it does (FileDelete()) instead of some arbitrary name (MonkeyBrains()). Its a descriptive measure to help at-a-glance reading of code. 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