Skip to main content
August 31, 2012
Answered

Can I set a key command to output two different PDFs - each at two different pre-set levels of quali

  • August 31, 2012
  • 1 reply
  • 2834 views

Bascially I'm trying to set up an Apple Automator script so that I can key-command or alt-click on a document and a series of things will happen.

1) Document opens

2) Document exports in 'high res' PDF setting.

3) Automator adds "HR" to the file name.

4) Document exports in 'low res' PDF setting.

3) Automator adds "LR" to the file name.

Can this be done? Surely it's not THAT technical?

Some kind of script is no-doubt in order...!

This topic has been closed for replies.
Correct answer -hans-

hi,

fill your pdfPresets in the first two lines. Save as Script. Launch by Spark, buttler ... with keyCommand.

(You can also launch it from AS-Editor)

Code could easily be edited as Droplet or Programm ...

--has to be set by user

property myLowres : "presetNameForLowRes"

property myHighres : "presetNameForHighRes"

tell application "Finder"

    set myFiles to selection as alias list

end tell

repeat with i from 1 to count of myFiles

    set theFile to item i of myFiles

    set testFiles to {folder, file creator} of (info for theFile)

   

    if testFiles is equal to {false, "InDn"} then

        tell application "Adobe InDesign CS5.5"

            set myFile to open theFile

            set filePath to file path of myFile

            set fileName to name of myFile

            set {lrFilePath, hrFilePath} to my getTargetPaths(filePath, fileName)

            export myFile format PDF type to lrFilePath using PDF export preset myLowres without showing options

            export myFile format PDF type to hrFilePath using PDF export preset myHighres without showing options

            close myFile saving no

        end tell

       

    end if

   

end repeat

on getTargetPaths(fileObject, nameString)

    set folderPath to fileObject as text

    set AppleScript's text item delimiters to {"."}

    if (count of text items of nameString) is 1 then

        set {lr, hr} to {folderPath & nameString & "_lr.pdf", folderPath & nameString & "_lr.pdf"}

    else

        set {lr, hr} to {folderPath & (text items 1 thru -2 of nameString) & "_lr.pdf", folderPath & (text items 1 thru -2 of nameString) & "_hr.pdf"}

    end if

    return {lr, hr}

    set AppleScript's text item delimiters to {""}

end getTargetPaths

... and please don't ask me anything about 'Automator'

1 reply

-hans-Correct answer
Inspiring
August 31, 2012

hi,

fill your pdfPresets in the first two lines. Save as Script. Launch by Spark, buttler ... with keyCommand.

(You can also launch it from AS-Editor)

Code could easily be edited as Droplet or Programm ...

--has to be set by user

property myLowres : "presetNameForLowRes"

property myHighres : "presetNameForHighRes"

tell application "Finder"

    set myFiles to selection as alias list

end tell

repeat with i from 1 to count of myFiles

    set theFile to item i of myFiles

    set testFiles to {folder, file creator} of (info for theFile)

   

    if testFiles is equal to {false, "InDn"} then

        tell application "Adobe InDesign CS5.5"

            set myFile to open theFile

            set filePath to file path of myFile

            set fileName to name of myFile

            set {lrFilePath, hrFilePath} to my getTargetPaths(filePath, fileName)

            export myFile format PDF type to lrFilePath using PDF export preset myLowres without showing options

            export myFile format PDF type to hrFilePath using PDF export preset myHighres without showing options

            close myFile saving no

        end tell

       

    end if

   

end repeat

on getTargetPaths(fileObject, nameString)

    set folderPath to fileObject as text

    set AppleScript's text item delimiters to {"."}

    if (count of text items of nameString) is 1 then

        set {lr, hr} to {folderPath & nameString & "_lr.pdf", folderPath & nameString & "_lr.pdf"}

    else

        set {lr, hr} to {folderPath & (text items 1 thru -2 of nameString) & "_lr.pdf", folderPath & (text items 1 thru -2 of nameString) & "_hr.pdf"}

    end if

    return {lr, hr}

    set AppleScript's text item delimiters to {""}

end getTargetPaths

... and please don't ask me anything about 'Automator'

September 3, 2012

Thanks mate! Amazing!
I'll try it all out...

September 3, 2012

Sorry but this seems to happen!

Also, as well as Indesign 5.5 I have Indesign 6, do I just change the name within the code and it'll work? Or should I leave v6 alone with this..?

Much appreciated!