I have an AppleScript that I use to import PDF’s that have crop and bleed marks and then exports the trimmed PDF. All I need the script to do is import the PDF and crop at Trim Box and the export.
The script works perfectly in CS4 but in CS 5.5 and 6 The PDF’s are not centered. These are single page PDF’s
Here is the Script. Any help would be very much appreciated.
tell application “Finder”
set myFolder to (choose folder with prompt "Select the folder containing the PDFs you want to convert")
set myFiles to count every item of folder myFolder
set PDF_List to every item of folder myFolder as alias list
set folder_path to (choose folder with prompt "Select folder to Save PDF files") as string
tell application "Adobe InDesign CS6"
activate
set pdf_style to name of PDF export presets
set export_style to (choose from list pdf_style with prompt "Select PDF Export Preset") as string
repeat with i from 1 to myFiles
activate
set page number of PDF place preferences to 2
set FormDoc to make document
tell document preferences of FormDoc
set {page height, page width} to {"9.25 in", "11.75 in"}
end tell
tell FormDoc
try
set LayerName to layer "Image layer" of FormDoc
on error
set LayerName to make layer with properties {visible:true, locked:false, name:"PDF"}
delete layer 2
end try
delete color "C=100 M=0 Y=0 K=0"
delete color "C=0 M=0 Y=100 K=0"
delete color "C=0 M=100 Y=0 K=0"
delete color "C=15 M=100 Y=100 K=0"
delete color "C=75 M=5 Y=100 K=0"
delete color "C=100 M=90 Y=10 K=0"
tell FormDoc
set the_frame to make text frame
set the geometric bounds of the_frame to {"0 in", "0 in", "11.75 in", "9.25 in"}
tell the_frame
set fitting alignment of frame fitting options to center anchor
set pdf_page to place (item i of PDF_List) on the_frame
set newName to text 1 thru -5 of name of (info for item i of PDF_List)
set PDF_name to folder_path & newName & "_ iPad" & ".pdf"
tell FormDoc
export format PDF type to PDF_name using export_style without showing options
close FormDoc saving no
end tell
end tell
end tell
end tell
end repeat
end tell
beep
display dialog "Your PDFs are Done" buttons {"Done"} default button 1
end tell