Sign in to follow this  
Followers 0
joen0s

script not working

5 posts in this topic

hi i hope someone can help me with my script

CODE
Opt("MouseCoordMode",0)

if fileexists("c:\inventarisatie.txt") then Exit

else

Run("everest.exe")

WinWait("EVEREST Ultimate Edition 2006","",20)

If Not WinActive("EVEREST Ultimate Edition 2006","") Then WinActivate("EVEREST Ultimate Edition 2006","")

WinWaitActive("EVEREST Ultimate Edition 2006","")

Send("{ALTDOWN}{ALTUP}rr")

WinWait("Rapport Assistent - EVEREST","")

If Not WinActive("Rapport Assistent - EVEREST","") Then WinActivate("Rapport Assistent - EVEREST","")

WinWaitActive("Rapport Assistent - EVEREST","")

Send("vvvk")

ProcessWait("Bericht - EVEREST", 10)

WinWait("Bericht - EVEREST","")

If Not WinActive("Bericht - EVEREST","") Then WinActivate("Bericht - EVEREST","")

WinWaitActive("Bericht - EVEREST","")

Send("{CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{F4}{ALTUP}")

WinWait("EVEREST Ultimate Edition 2006","")

If Not WinActive("EVEREST Ultimate Edition 2006","") Then WinActivate("EVEREST Ultimate Edition 2006","")

WinWaitActive("EVEREST Ultimate Edition 2006","")

Send("{ALTDOWN}{F4}{ALTUP}")

Run("notepad.exe")

WinWait("Naamloos - Kladblok","")

If Not WinActive("Naamloos - Kladblok","") Then WinActivate("Naamloos - Kladblok","")

WinWaitActive("Naamloos - Kladblok","")

Send("{CTRLDOWN}v{CTRLUP}{CTRLDOWN}s{CTRLUP}")

WinWait("Opslaan als","")

If Not WinActive("Opslaan als","") Then WinActivate("Opslaan als","")

WinWaitActive("Opslaan als","")

Send("c:\inventarisatie.txt")

Send("{ALTDOWN}{F4}{ALTUP}")

with this script i get a error

N:\EVEREST Ultimate Edition\abc.au3 (3) : ==> "Else" statement with no matching "If" statement.:

else

help me please

Share this post


Link to post
Share on other sites



CODE

if fileexists("c:\inventarisatie.txt") then Exit

else

Use either one-line If statements, or multiple lines. If you have a command on the same line after "then", then it is a one-line statement, so the Else is NOT part of this statement. And that's why AutoIt complains that there is no matching If/then.

Just put the "Exit" on a new line.

Share this post


Link to post
Share on other sites

Use either one-line If statements, or multiple lines. If you have a command on the same line after "then", then it is a one-line statement, so the Else is NOT part of this statement. And that's why AutoIt complains that there is no matching If/then.

Just put the "Exit" on a new line.

I would say it's missing EndIf ;p

Opt("MouseCoordMode",0)
If fileexists("c:\inventarisatie.txt") then
    Exit
Else
    Run("everest.exe")
EndIf
WinWait("EVEREST Ultimate Edition 2006","",20)
If Not WinActive("EVEREST Ultimate Edition 2006","") Then WinActivate("EVEREST Ultimate Edition 2006","")
WinWaitActive("EVEREST Ultimate Edition 2006","")
Send("{ALTDOWN}{ALTUP}rr")
WinWait("Rapport Assistent - EVEREST","")
If Not WinActive("Rapport Assistent - EVEREST","") Then WinActivate("Rapport Assistent - EVEREST","")
WinWaitActive("Rapport Assistent - EVEREST","")
Send("vvvk")
ProcessWait("Bericht - EVEREST", 10)
WinWait("Bericht - EVEREST","")
If Not WinActive("Bericht - EVEREST","") Then WinActivate("Bericht - EVEREST","")
WinWaitActive("Bericht - EVEREST","")
Send("{CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{F4}{ALTUP}")
WinWait("EVEREST Ultimate Edition 2006","")
If Not WinActive("EVEREST Ultimate Edition 2006","") Then WinActivate("EVEREST Ultimate Edition 2006","")
WinWaitActive("EVEREST Ultimate Edition 2006","")
Send("{ALTDOWN}{F4}{ALTUP}")
Run("notepad.exe")
WinWait("Naamloos - Kladblok","")
If Not WinActive("Naamloos - Kladblok","") Then WinActivate("Naamloos - Kladblok","")
WinWaitActive("Naamloos - Kladblok","")
Send("{CTRLDOWN}v{CTRLUP}{CTRLDOWN}s{CTRLUP}")
WinWait("Opslaan als","")
If Not WinActive("Opslaan als","") Then WinActivate("Opslaan als","")
WinWaitActive("Opslaan als","")
Send("c:\inventarisatie.txt")
Send("{ALTDOWN}{F4}{ALTUP}")
]

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

thnx you all

it is now working,

Share this post


Link to post
Share on other sites

I would say it's missing EndIf ;p

Yep, that was another error, I only saw the first error.

Share this post


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
Sign in to follow this  
Followers 0