Sign in to follow this  
Followers 0
dazzyreil

Whats Wrong With This Script ?

4 posts in this topic

GUICreate ( "Bla Bla ", 450, 300)

$not = GuiSetControl("button", "Run Notepad",  10, 30, 150)

$war = GuiSetControl("button", "Run explorer",  10, 100, 150)

GuiWaitClose()

$not = Run("notepad.exe")

$war = Run("explorer.exe")

exit

why does it run both programs ??


Share this post


Link to post
Share on other sites



It uses regular AutoIt script, you would need to have an if statement.

$not = Run("notepad.exe")

$war = Run("explorer.exe")

is the same as:

Run("notepad.exe")
Run("explorer.exe")

except that you don't get the exit code to become the variables you call out.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

GUICreate ( "Bla Bla ", 450, 300)

$not = GuiSetControl("button", "Run Notepad",  10, 30, 150)

$war = GuiSetControl("button", "Run explorer",  10, 100, 150)

GuiWaitClose()

$not = Run("notepad.exe")

$war = Run("explorer.exe")

exit

why does it run both programs ??

You need to check which button has closed the GUI

GUICreate ( "Bla Bla ", 450, 300)

$not = GuiSetControl("button", "Run Notepad",  10, 30, 150)

$war = GuiSetControl("button", "Run explorer",  10, 100, 150)

GuiWaitClose()

if $not = GuiRead() then  Run("notepad.exe")

if $war =GuiRead() then Run("explorer.exe")

exit

:D

Share this post


Link to post
Share on other sites

thank you :huh2::D


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