Auto-It-Noob Posted December 30, 2005 Posted December 30, 2005 hi,i created an auto-it loop and want to exit auto-it if the text end comes.i tried this:If WinExists("Editor","end") Then Exitbut the loop / auto-it doesn't exit and the loop continue all the time can someone tell me my mistake please?
seandisanti Posted December 30, 2005 Posted December 30, 2005 hi,i created an auto-it loop and want to exit auto-it if the text end comes.i tried this:but the loop / auto-it doesn't exit and the loop continue all the time can someone tell me my mistake please?more code would be necessary to see why your exit condition isn't being met. one tip, you probably want exitloop instead of exit..
BigDod Posted December 30, 2005 Posted December 30, 2005 I do not know if this helps While 1 Sleep(100) If WinExists("Untitled -", "end") Then Exit EndIf WEnd Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Auto-It-Noob Posted December 30, 2005 Author Posted December 30, 2005 expandcollapse popupOpt("WinWaitDelay",0) While 1 WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("url{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") ^ ^ ^ ^ ^ If WinExists("Editor", "end") Then Exitloop ^ ^ ^ ^ ^ WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("{SPACE}{SHIFTDOWN}4{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("{SPACE}{SHIFTDOWN}4{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{ DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}x{CTRLUP}{CTRLDOWN}f{ CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}ow{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{CTRLDOWN}v{CTRLUP}{CTRLDOWN}{ALTDOWN}q{CTRLUP}{ALTUP}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("username{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}ow{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}uw{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}ftp://{CTRLDOWN}v{CTRLUP}{SHIFTDOWN}.{SHIFTUP}") WEnd the code is crap.. but it works except the exitloop While 1 Sleep(100) If WinExists("Untitled -", "end") Then Exit EndIf WEnd i tried this, too. but i got this error: "EndIf" statement with no matching "If" statement.
seandisanti Posted December 30, 2005 Posted December 30, 2005 expandcollapse popupOpt("WinWaitDelay",0) While 1 WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("url{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") ^ ^ ^ ^ ^ If WinExists("Editor", "end") Then Exitloop ^ ^ ^ ^ ^ WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("{SPACE}{SHIFTDOWN}4{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("{SPACE}{SHIFTDOWN}4{SHIFTUP}{ALTDOWN}w{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{ DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{DEL}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}x{CTRLUP}{CTRLDOWN}f{ CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}ow{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{CTRLDOWN}v{CTRLUP}{CTRLDOWN}{ALTDOWN}q{CTRLUP}{ALTUP}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("username{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}ow{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{CTRLDOWN}f{CTRLUP}") WinWait("Suchen","Groß-/Kleins&chreibu") If Not WinActive("Suchen","Groß-/Kleins&chreibu") Then WinActivate("Suchen","Groß-/Kleins&chreibu") WinWaitActive("Suchen","Groß-/Kleins&chreibu") Send("ftp{SHIFTDOWN}.{SHIFTUP}{ALTDOWN}uw{F4}{ALTUP}") WinWait("Accounts - test.txt - Editor","") If Not WinActive("Accounts - test.txt - Editor","") Then WinActivate("Accounts - test.txt - Editor","") WinWaitActive("Accounts - test.txt - Editor","") Send("{RIGHT}ftp://{CTRLDOWN}v{CTRLUP}{SHIFTDOWN}.{SHIFTUP}") WEnd the code is crap.. but it works except the exitloop While 1 Sleep(100) If WinExists("Untitled -", "end") Then Exit EndIf WEnd i tried this, too. but i got this error:try While 1 Sleep(100) If WinExists("Untitled -", "end") Then ExitLoop WEnd
Auto-It-Noob Posted December 30, 2005 Author Posted December 30, 2005 it doesn't stop with: While 1 Sleep(100) If WinExists("Untitled -", "end") Then ExitLoop WEnd & While 1 Sleep(100) If WinExists("Editor", "end") Then ExitLoop WEnd
Moderators SmOke_N Posted December 30, 2005 Moderators Posted December 30, 2005 Just out of curiousity... Is "Editor" the title of the window that contains the 'word' "end" in it? 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.
seandisanti Posted December 30, 2005 Posted December 30, 2005 it doesn't stop with: While 1 Sleep(100) If WinExists("Untitled -", "end") Then ExitLoop WEnd & While 1 Sleep(100) If WinExists("Editor", "end") Then ExitLoop WEndtry: While 1 Sleep(100) If WinExists("Untitled -", "") Then ExitLoop WEnd
Auto-It-Noob Posted December 31, 2005 Author Posted December 31, 2005 Just out of curiousity... Is "Editor" the title of the window that contains the 'word' "end" in it?i think it's editor ^^@cameronsdadit doesn't work, too
grakker Posted December 31, 2005 Posted December 31, 2005 Maybe add something like Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced
seandisanti Posted January 1, 2006 Posted January 1, 2006 i think it's editor ^^@cameronsdadit doesn't work, tooit doesn't work because the title is Editor not Untitled - change the string and it should work...
gamerman2360 Posted January 1, 2006 Posted January 1, 2006 Mabey:If WinExists("Editor", '"end"') Then ExitLoop
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