Applescript: How do I attach a script to an event??


i have applescript creates pdf , uploads specific destination. (see below)

 

i want invoke script every time user "saves" doc.

 

i novice when comes indesign applescripting...i don't know if possible attach script "save" function??

 

i guessing need incorporate event listener?? again guessing. perhaps there better way? attach script key combo command-s??

 

the objective give user option send pdf every time save document.

 

here script far:

 

......................

 

set _exportpdf (display dialog "send proof?" with icon caution buttons {"cancel", "pdf"} default button 2)

tell application "adobe indesign cs6"

  if button returned of _exportpdf "pdf" then

  set myfolder "pdfproofs:"

  set _dest myfolder unicode text

  set screensettings pdf export preset "[high quality print]"

  set page range of pdf export preferences all pages

  set docname name of document 1

  if docname ends ".indd" then

  set docname text 1 thru -6 of docname

  end if

 

  tell application "adobe indesign cs6"

  export document 1 format pdf type to (_dest & docname & ".pdf") using screensettings without options

  if modified of active document true then

  tell active document save

  close document 1

  end if

  (*

           tell pdf export preferences

               set view pdf true

           end tell

           *)

  end tell

  end if

end tell

 

......................

ok see can save script "start-up" script (i.e. applications>adobe indesign>scripts>startup scripts) how make script run on "save" doc??

 

anyone?? bueller? anyone??



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Adobe Reader DC install error 150410

Error: 100600 Update failed, updates have been disabled by your system policy

ReferenceError: Window does not have a constructor : 325