Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

CS5.5 (Applescript) Packaging and PDF creation script

$
0
0

Hello there.

 

I have an applescript droplet which, once an InDesign file is dragged onto it, it creates:

 

  • a High Quality PDF;
  • a Press Quality PDF;
  • a Smallest File Size PDF; and
  • a packaged InDesign file without the instructions.txt.

It's an amazing script but I need it to do one more thing... put the four items into its own folder.

 

Here is how the script looks so far:

 

 

on open mgItems    repeat with mgThisItem in mgItems                tell application id "com.adobe.InDesign"            try                open mgThisItem                set mgDocName to name of active document                set text item delimiters of AppleScript to " "                set mgShortName to text item 1 of mgDocName                set text item delimiters of AppleScript to ""                set mgHRFilePath to "Macintosh HD:Users:colly:Desktop:testfolder:" & mgShortName & "_HR.pdf" as string                set properties of PDF export preferences to properties of PDF export preset "[High Quality Print]"                tell active document                    export format PDF type to mgHRFilePath without showing options                end tell                set mgHRDigitalFilePath to "Macintosh HD:Users:colly:Desktop:testfolder:" & mgShortName & "_HRD.pdf" as string                set properties of PDF export preferences to properties of PDF export preset "[Press Quality]"                tell active document                    export format PDF type to mgHRDigitalFilePath without showing options                end tell                set mgProofFilePath to "Macintosh HD:Users:colly:Desktop:testfolder:" & mgShortName & "_proof.pdf" as string                set properties of PDF export preferences to properties of PDF export preset "[Smallest File Size]"                tell active document                    export format PDF type to mgProofFilePath without showing options                end tell                set mgPackageFilePath to "Macintosh HD:Users:colly:Desktop:testfolder:" & mgShortName as string                tell active document                    package to mgPackageFilePath with copying fonts, ignore preflight errors, copying profiles, updating graphics, including hidden layers, copying linked graphics and creating report                end tell                close active document            on error                -- decide what kind of error handling you want to include if the file won't open            end try        end tell            end repeat    display dialog "PDFs created and InDesign file packaged"
end open

 

As it works at the moment, many indesign files can be dragged onto this droplet, but they all end up in the same folder e.g. upon processing two indesign files, one called namequestion and the other called splash, all files populate the one folder as such:

 

namequestion.indd

namequestion.indd_HR.pdf

namequestion.indd_HRD.pdf

namequestion.indd_proof.pdf

splash.indd

splash.indd_HR.pdf

splash.indd_HRD.pdf

splash.indd_proof.pdf

 

what I would like the script to do is put each set of 4 items into their own folders e.g.

 

namequestion (folder)

   namequestion.indd

   namequestion.indd_HR.pdf

   namequestion.indd_HRD.pdf

   namequestion.indd_proof.pdf

 

splash (folder)

   splash.indd

   splash.indd_HR.pdf

   splash.indd_HRD.pdf

   splash.indd_proof.pdf

 

it's probably a rather simple fix but this is my first crack at an applescript... normally play with javascript and still learning all that.

 

Peter Kahrel has a very good javascript at http://www.kahrel.plus.com/indesign/batch_convert.html  but to get the outcome above (that's how it's been told to be made) Pete's script has to be run four times with much drag and dropping afterwards.

 

Many thanks

 

Colin


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>