Jump to content

Recommended Posts

Posted

I would like to have my script start a program if it isnt already, but otherwise just continue. This is part of a function, so i cant just put the WinExists in an If statement and the rest of the script in an Else. Here's my code:

Func StartAim()
    Run($Path)
    WinWait($Aim, "", 20)
EndFunc

Is there a way to just tell it to only perform this operation if the window doesnt exist? Such as

Func StartAim()
    If WinExists($Aim) = 0 then
                Run($Path)
    WinWait($Aim, "", 20)
EndFunc
Posted

Maybe like this?

Func StartAim()
   If WinExists($Aim) then
;Do nothing
   Else
    Run($Path)
    WinWait($Aim, "", 20)
    Endif
EndFunc
-Brett
Posted (edited)

So a line with nothing on it will make the script do nothing?

EDIT:To clarify, I mean a line following an If and preceding an Else.

Edited by SweatyOgre

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...