Set Error capture [on]
If [ get ( lastError ) // cancel was clicked]
Thanks Phil. I didn't understand for need for the "If" statement but just adding the Set Error Capture [no] before the print function worked like a charm.
You only need the If step if there are script steps after your print that should not be executed if the user elects to cancel.