Peter: Executing a Prompt as "do script" - any way to support Cancel?

@peternlewis Peter -

If I build a “Prompt for User Input” plist, and execute it via AppleScript using “Do Script”, when the user clicks a button that is flagged as “Cancel Macro”, it doesn’t cancel the macro that called the “do script”. I can understand this, but is there any way I can tell that the macro should be canceled?

And am I correct that “do script” will only work for one action? Because if it supported more than one action, and “Cancel Macro” caused the second action to NOT execute, then I could figure it out that way.

I actually know all the buttons and whether they’re “Cancel Macro” buttons, so I can probably figure it out, but it’s not straightforward because of the “/” combinations you support that don’t get returned in the “Result Button” variable. If this is the way to go, stripping this stuff out is child’s play, except I don’t want to strip out something that you wouldn’t normally strip out of a button caption. So I don’t need any KM examples - just the logic to make sure I strip out the correct things.

Thoughts? Thanks.

Whether the “do script” script is canceled or not is not returned to the AppleScript. And in turn the Execute AppleScript cannot “fail” per se, it simply returns the error message if it fails in some way, so even if it did you could not return the "cancel"ness.

Yes, “do script” only accepts one action. But that action could be a Group action.

1 Like