Skip to main content
jduncan
Community Expert
Community Expert
July 14, 2022
Answered

Exit status of built-in command dialog

  • July 14, 2022
  • 5 replies
  • 577 views

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!

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer m1b

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

5 replies

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
July 14, 2022

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

jduncan
Community Expert
jduncanCommunity ExpertAuthor
Community Expert
July 14, 2022

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!