Skip to main content
Known Participant
March 3, 2010
Question

How to run a script on InDesign startup?

  • March 3, 2010
  • 2 replies
  • 14199 views

How to run a script on InDesign startup?

Or jast after it open one document?

Is there any method like Excel VBA "Auto_Open" ?

This topic has been closed for replies.

2 replies

November 3, 2011

Thank YOU!

i will have my IT guy look at this!

Marc Autret
Legend
March 3, 2010

To make a script autorun on InDesign startup, put the script in a subfolder named "Startup Scripts" (under the app or user Scripts folder).

To make a script run on InDesign document opening, attach an event listener to the beforeOpen or afterOpen document event, e.g. (in JS):

app.addEventListener( "beforeOpen" , function(){alert("Opening a document...");} );

Note that the script must have a session persistence (#targetengine 'mysession') if your event handler is enclosed within. You alternately can put the event handler in an external file, then no session scope is required.

Known Participant
March 3, 2010

Thank you very much!