Jump to content

Recommended Posts

Posted

If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")<---[B]instead of msgbox, how can i make the computer do "nothing" or like sleep kinda[/B]
EndIf

and how can i add: " is process doesnt exist , then do BLAH"

  • Developers
Posted

If ProcessExists("notepad.exe") Then
    MsgBox(0, "Example", "Notepad is running.")<---[B]instead of msgbox, how can i make the computer do "nothing" or like sleep kinda[/B]
EndIf

and how can i add: " is process doesnt exist , then do BLAH"

<{POST_SNAPBACK}>

While 1
    While ProcessExists("notepad.exe") 
        sleep(10)
    WEnd
; do here what you want to do when process doesn't exists
WEnd

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

If ProcessExists("notepad.exe") Then

Sleep('1000')

Else

MsgBox(0,"Title", "Message", "10")

EndIf

You can put the While loop inside of the If statement so that it continues to sleep until the process doesn't exist any more. Make sure to change the "While 1" to "While ProcessExists("notepad.exe")" else it will not stop sleeping, and the script will never end.

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Posted

use the exitloop command for exiting the loop

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

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
×
×
  • Create New...