Jump to content

If window exists, go on, else start program


Recommended Posts

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