Copy link to clipboard
Copied
Is there any way to get the exit status of a dialog tied to a built-in command? Take the script below...
// do some stuff
app.executeMenuCommand("Path Blend Options");
// do some more stuff
If the user cancels the built-in dialog that pops up for "Blend Options" I don't want to continue with "do some more stuff". I have looked through tons of ExtendScript Debugger variables and the docs, and I can't seem to figure it out.
Thanks in advance for your help!
Hi @jduncan, I couldn't find a way. It might not be possible.
One crazy idea hack I thought of, that should work, was to export the selection, eg. Document.exportSelectionAsAi(tempFile) before and after the dialog and compare them: assume if they are identical in content that the user cancelled the dialog? Maybe SVG would be better because easier to compare.
- Mark
Copy link to clipboard
Copied
Hi @jduncan, I couldn't find a way. It might not be possible.
One crazy idea hack I thought of, that should work, was to export the selection, eg. Document.exportSelectionAsAi(tempFile) before and after the dialog and compare them: assume if they are identical in content that the user cancelled the dialog? Maybe SVG would be better because easier to compare.
- Mark
Copy link to clipboard
Copied
that is one crazy idea Lollll
Copy link to clipboard
Copied
Haha @CarlosCanto, I'm so tempted to mark your answer as Correct!
Copy link to clipboard
Copied
come to think of it, it doesn't sound that crazy
Copy link to clipboard
Copied
Ha! Now that's some creative thinking. Knowing the exit status is not critical for the script I'm working on, I just thought it would be a "nice to have" feature. I'll definitely keep this option in mind for any future issues I encounter. Thanks for your help!