Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7678 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a printing script that takes a user to a print layout in preview mode and pauses to allow them to make sure everything is correct. If they hit the cancel button, I want to redirect them to a certain layout. How can I capture the cancel button being pushed? I tried doing Status(CurrentError) but that did not work or maybe I was looking for the wrong status. Any help would be appreciated!

Thanks,

John

Posted

Allow User Abort [off]

...

Go to Layout [print layout]

Enter Preview Mode [pause]

Set Error Capture [on]

Print []

If [status(CurrentError) = 1]

Go to Layout [other layout]

End If

...

If you're going to do it this way, make sure there are no script steps (not even comments) between the Print step and the If.

Posted

John-thanks for the floating control panel solution. It may come in handy.

Vaughan-Is there a way to capture the cancel that the preview pause offers? That is if I don't turn off Allow user abort. The way you mentioned works, but it puts in an extra step if something is wrong with the labels and they don't want to print. If something is wrong, it would be nice for them just to hit cancel on the preview screen instead of having to hit continue and then cancel in the print setup window. Maybe this isn't possible and I will have to settle with the extra step. I am just always looking for ways to simplify the process. Thanks for help so far!

John

Posted

My problem with Cancel on a preview screen is that it leaves the user right where the script gets killed, which I believe is bad interface. And if user about is on, they can kill the script *anywhere* by pressing Esc.

To get what you want you could offer the user a dialog after they click Continue...

Allow User Abort [off]

...

Go to Layout [print layout]

Enter Preview Mode [pause]

Show Message ["Print the report?", "OK", "Cancel"]

If [status(CurrentMessageChoice) = 1]

Print []

End If

...

Posted

I've been experimenting combining Vaughan's suggestion with Caballero's solution:

Go to Layout [print layout]

Enter Preview Mode []

Set Zoom Level [75%]

Loop

Show Message ["Print the report?", "OK", "Next Page", "Prev. Page"]

Exit Loop If ["Status(CurrentMessageChoice) = 1"]

If ["Status(CurrentMessageChoice) = 2"]

Go to Record/Request/Page [Next]

End If

If ["Status(CurrentMessageChoice) = 3"]

Go to Record/Request/Page [Previous]

End If

End Loop

Print []

I make sure to pause at the print dialogue, so that the user has a chance to cancel. It isn't perfect, but maybe somebody could build on this approach!

This topic is 7678 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.