Sign in to follow this  
Followers 0
Guest Meflak

Pause a script and then continuing

5 posts in this topic

Ok I have been working fo rhours on some script that will allow me to automate some tasks but I have one problem I want a message box to appear as I run the program to say Press enter to run the program.. Or have push yes to start the program. and if they dont/hit no the program ends..

I just am having a magor brain fart its so stupid right now...

Share this post


Link to post
Share on other sites



Ok I have been working fo rhours on some script that will allow me to automate some tasks but I have one problem I want a message box to appear as I run the program to say Press enter to run the program.. Or have push yes to start the program. and if they dont/hit no the program ends..

I just am having a magor brain fart its so stupid right now...

<{POST_SNAPBACK}>

try the MsgBox function. It can have Yes and No buttons and will return a code depending on which one was clicked.

Share this post


Link to post
Share on other sites

try the MsgBox function.  It can have Yes and No buttons and will return a code depending on which one was clicked.

<{POST_SNAPBACK}>

I know that much I have one to exit the script but how do I pause the script wait.. it the msg box returns a no just skip the prog and exit and just make sure the msg box is out of the main loop.. bah I am so tired right now thanks though

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Msgboxes automatically pause the script. Just say If MsgBox(4, "", "") = 6 Then (user pressed yes)

Else

(they pressed something else)

endif

isnt that all u need?

Edited by datkewlguy

Share this post


Link to post
Share on other sites

MsgBox() should be what you need, but I suggest looking for a "no" (7) response from it, so as not to get a compilation error should you forget an EndIf at the end of the script

if $msgboxret = "7" Then Exit

is easier than

if $msgboxret = "6" Then
;all
;your
;code
Else
Exit
Endif

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

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