15 Replies Latest reply on Dec 6, 2018 10:56 AM by Kevin Parrott

    how to translate export pdf from applescript to extend scriipt

    Kevin Parrott Level 2

      Hi All

      I use the below applescript to export a PDF from Indesign CC 2019 to a folder on my desktop that begins with "Q", it works

      well and as expected, what I am wanting to do is try the same set up in extend script, my problem is I don't no how to write

      it, can some one please help translate this to extend script, using the same variables etc, and with out user interaction?

      thank you in advance.


      tell application "Finder"

          set myFolder to POSIX path of ((folders of desktop whose name begins with "Q") as string)

      end tell


      tell application id "com.adobe.InDesign"

          set myDoc to active document

          set docName to name of myDoc as string


          set _dest to myFolder as Unicode text

          delete unused swatches of document 1

          set screenSettings to PDF export preset "USE THIS TO DISTILL-1"

          set page range of PDF export preferences to all pages


          set PathToDesktop to file path of document 1 as string

          set this_folder to (PathToDesktop) as alias

          export document 1 format PDF type to (_dest & docName & ".pdf") using screenSettings without options

          close document 1 saving yes

          tell PDF export preferences

              set view PDF to true

          end tell

      end tell