Ask>if yes do X, if no do Y

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
johnnygrr
Newbie
Posts: 6
Joined: Tue Feb 02, 2010 1:18 am

Ask>if yes do X, if no do Y

Post by johnnygrr » Tue Feb 02, 2010 1:47 am

Hello again,
How do I get a an ask command to also run an if statement? for example:

If you click yes on the Ask button, print the page then return to running the rest of the macro, if you click no on the ask button just return to running the rest of the macro.

Thanks for all your help guys

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Feb 02, 2010 5:55 am

Code: Select all

Ask>Do you want to Print this?,vAnswer
// Ask> result will be YES or NO, in UPPERCASE
IF>%vAnswer%=YES,Print,NextStep

Label>Print
Commands to print go here.....
Script continues here....

Label>NextStep
Remainder of the script goes here....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

johnnygrr
Newbie
Posts: 6
Joined: Tue Feb 02, 2010 1:18 am

Post by johnnygrr » Wed Feb 03, 2010 1:18 am

Dear Bob,
Thank you for your reply, its helped a lot. How do I stop the macro continuing with the NextStep label? I have tried inserting ENDIF and end>Print at the end of the print label but to no avail!
Any help from Bob or anyone else, as always, most appreciated!
J

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Feb 03, 2010 1:44 am

Ask>Do you want to Print this?,vAnswer
// Ask> result will be YES or NO, in UPPERCASE
IF>%vAnswer%=YES,Print,NextStep

Label>Print
Commands to print go here.....
Script continues here....
GoTo>AnotherStep

Label>NextStep
Remainder of the script goes here....
GoTo>End

LabeL>AnotherStep
Other things happening here.....
GoTo>End

Label>End
End of macro is here.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts