Cancel Input Doesn't Cancel Macro?
Moderators: Dorian (MJT support), JRL
Cancel Input Doesn't Cancel Macro?
The first thing my macro does is ask for Input> from the user. Hitting Cancel simply skips that step of the process, though. Can I get Cancel to end the macro?
Thanks,
Josh
Josh
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
How about testing the variable returned by Input> and if it's blank then jump to the end of the macro like:
Input>mydata,Please input a value,
If>mydata=,finish,continue
Label>continue
MessageModal>%mydata%
//do other stuff
Label>finish
MessageModal>The End
If that idea won't work for you then please post your script.
Input>mydata,Please input a value,
If>mydata=,finish,continue
Label>continue
MessageModal>%mydata%
//do other stuff
Label>finish
MessageModal>The End
If that idea won't work for you then please post your script.
Hmmm. Maybe I'm applying this incorrectly; I have never used Label before. There is more to my code than posted here, but it's just variations on the theme to handle the different check boxes.
Let>Input_Browse=0
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
Label>Continue
Dialog>Dialog3
Caption=Dialog3
Width=289
Height=246
Top=104
Left=16
Label=Select a database to distribute.,32,8,true
CheckBox=msCheckBox1,Clarify Research,32,24,97,False
CheckBox=msCheckBox2,OA Change,32,72,97,False
Button=OK,192,8,75,25,5
CheckBox=msCheckBox3,Prodcution Training,32,120,129,False
CheckBox=msCheckBox4,Ship Short,32,168,105,False
CheckBox=msCheckBox5,PMO Data Entry,32,96,97,False
CheckBox=msCheckBox6,Quality Training,32,144,97,False
CheckBox=msCheckBox7,SOA Millennium Reports,32,192,137,False
CheckBox=msCheckBox8,Internal Audit,32,48,97,False
EndDialog>Dialog3
Show>dialog3,r3
If>r3=2,finish
If>%Dialog3.mscheckbox1%=True
Let>SaveClarifyResearchVariableForLaterUse=True
Else
Let>SaveClarifyResearchVariableForLaterUse=False
EndIf
If>%SaveClarifyResearchVariableForLaterUse%=True
Let>SendMail_Status=1
Let>Subject=Clarify Research Database Installation
Let>me=[email protected]
Let>MyName=Josh
Let>Recipients=%Email%
Let>body=Follow these instructions to install the attached Clarify Research database.%CRLF%%CRLF%1. Delete any shortcuts to the Clarify Research database you may have on your desktop.%CRLF%2. 1. Open the attached .zip file.%CRLF%3. In the WinZip window, double-click the .bat file.%CRLF%4. A black window will open, please be patient and let it close on its own.%CRLF%5. Once the black window closes go to My Computer > C:\ >scrub.%CRLF%6. In the folder scurb right-click on prd_scrub_xp.bat and select Send to > Desktop (create shortcut).%CRLF%%CRLF%You will then have the database ready to use on your desktop.Please feel free to contact me with any questions or difficulties.%CRLF%%CRLF%Thanks,%CRLF%Josh%CRLF%x1234
Let>Attachments=\\Storage_Location\Setup_PRD_xp.zip
SMTPSendMail>recipients,emailserver.com,me,myname,subject,body,attachments
MDL>The Clarify Research database was sent to %email%
EndIf
Label>Finish
Let>Input_Browse=0
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
Label>Continue
Dialog>Dialog3
Caption=Dialog3
Width=289
Height=246
Top=104
Left=16
Label=Select a database to distribute.,32,8,true
CheckBox=msCheckBox1,Clarify Research,32,24,97,False
CheckBox=msCheckBox2,OA Change,32,72,97,False
Button=OK,192,8,75,25,5
CheckBox=msCheckBox3,Prodcution Training,32,120,129,False
CheckBox=msCheckBox4,Ship Short,32,168,105,False
CheckBox=msCheckBox5,PMO Data Entry,32,96,97,False
CheckBox=msCheckBox6,Quality Training,32,144,97,False
CheckBox=msCheckBox7,SOA Millennium Reports,32,192,137,False
CheckBox=msCheckBox8,Internal Audit,32,48,97,False
EndDialog>Dialog3
Show>dialog3,r3
If>r3=2,finish
If>%Dialog3.mscheckbox1%=True
Let>SaveClarifyResearchVariableForLaterUse=True
Else
Let>SaveClarifyResearchVariableForLaterUse=False
EndIf
If>%SaveClarifyResearchVariableForLaterUse%=True
Let>SendMail_Status=1
Let>Subject=Clarify Research Database Installation
Let>me=[email protected]
Let>MyName=Josh
Let>Recipients=%Email%
Let>body=Follow these instructions to install the attached Clarify Research database.%CRLF%%CRLF%1. Delete any shortcuts to the Clarify Research database you may have on your desktop.%CRLF%2. 1. Open the attached .zip file.%CRLF%3. In the WinZip window, double-click the .bat file.%CRLF%4. A black window will open, please be patient and let it close on its own.%CRLF%5. Once the black window closes go to My Computer > C:\ >scrub.%CRLF%6. In the folder scurb right-click on prd_scrub_xp.bat and select Send to > Desktop (create shortcut).%CRLF%%CRLF%You will then have the database ready to use on your desktop.Please feel free to contact me with any questions or difficulties.%CRLF%%CRLF%Thanks,%CRLF%Josh%CRLF%x1234
Let>Attachments=\\Storage_Location\Setup_PRD_xp.zip
SMTPSendMail>recipients,emailserver.com,me,myname,subject,body,attachments
MDL>The Clarify Research database was sent to %email%
EndIf
Label>Finish
Thanks,
Josh
Josh
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Let's trace this out:
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
Label>Continue
Ok, if finish = continue it is easy to see what happens here. Now let's see what happens if finish is NOT continue:
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
//finish was not continue so we just carry on
Label>Continue
//now we are here
..
..
So whatever the value of finish you get the same outcome. You've said (if finish is continue jump to the next line, if it is not continue we just carry on, which is Label>Continue anyway). Scripts read one line at a time
This is what you really want:
If>%EMAIL%=finish
..
.. your code here
..
Endif
Or:
If>%EMAIL%=finish,continue
Goto>end
Label>continue
...
Label>end
Or:
If>%EMAIL%=finish,continue,end
Label>continue
..
.. your code
..
Label>end
Read it one line at a time. Read the logic. You can see the paths it leads depending on the value.
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
Label>Continue
Ok, if finish = continue it is easy to see what happens here. Now let's see what happens if finish is NOT continue:
Input>Email, Enter Email Addresses
If>%Email%=,finish,continue
//finish was not continue so we just carry on
Label>Continue
//now we are here
..
..
So whatever the value of finish you get the same outcome. You've said (if finish is continue jump to the next line, if it is not continue we just carry on, which is Label>Continue anyway). Scripts read one line at a time
This is what you really want:
If>%EMAIL%=finish
..
.. your code here
..
Endif
Or:
If>%EMAIL%=finish,continue
Goto>end
Label>continue
...
Label>end
Or:
If>%EMAIL%=finish,continue,end
Label>continue
..
.. your code
..
Label>end
Read it one line at a time. Read the logic. You can see the paths it leads depending on the value.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Marcus -- you've misread the code, there is a comma between %Email%= and finish.
Josh the problem is that labels are case sensitive. Your line:
If>%Email%=,finish,continue
Is looking for a label with all lower case characters. At the end of your script is the label Label>Finish with an upper case "F".
You have the same issue with the continue/Continue label.
Josh the problem is that labels are case sensitive. Your line:
If>%Email%=,finish,continue
Is looking for a label with all lower case characters. At the end of your script is the label Label>Finish with an upper case "F".
You have the same issue with the continue/Continue label.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Oops. Sorry, you're right. Oh well, hopefully my post helps by offering some other options anyway.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?