Jump to content

Recommended Posts

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 :P

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..
Link to post
Share on other sites

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

Link to post
Share on other sites

Opt("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 :P

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.

Link to post
Share on other sites

Opt("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 :P

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
Link to post
Share on other sites
  • Moderators

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.

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...