Skip to main content
Steven__
Inspiring
March 23, 2010
Question

javascript - menuAction

  • March 23, 2010
  • 1 reply
  • 956 views

Is there a way to invoke a menuAction and wait until user has finished filling in resulting dialogs and actions are complete before continuing with script?

APID?

This topic has been closed for replies.

1 reply

Harbs.
Legend
March 23, 2010

Depends what you're doing...

Harbs

Steven__
Steven__Author
Inspiring
March 24, 2010

The reason this is impossible, is because the menu action opens the dialog and the dialog is not accessible until the script completes it work. Only then does the dialog become available for work. In the past I have been able to work around this when calling menuaction from external application through com or applescript, which doesn't run in the same thread as InDesign application, allowing modal dialog to be active and the loop in external application to wait until dialog has been dismissed.

John Hawkinson
Inspiring
March 24, 2010

That doesn't make it impossible. You can, for instance, #targetengine session and attach an event handler to the afterInvoke event associated with the modal dialogue. Then all your work happens in the event handler. This kind of event-driven programming can be more tricky, but doable.