I’m tring to export an indesign document to a PDF file and i want it to be exported with ICC profile and with the PDF X1a 2001 presets.
Here is my code :
set acrobat compatibility to acrobat 4
set include icc profiles to true -- how do we choose the icc profile ? menu "edition / colors..." ?
tell active document
export format PDF type to MyFile using "[PDF/X-1a:2001]" without showing options
end tell
The problem is the “using […]” overwrite my “set include …” command !
How can i tell the script to use / load “[PDF/X-1a:2001]” before telling him to include ICC ?
Thanks
David (sorry for the english, i’m french … lol)
You will have to avoid using “using…”. Try something like this:
set theProps to properties of PDF export preset "[PDF/X-1a:2001]"
set newProps to {acrobat compatibility: acrobat 4, include icc profiles: true} & theProps
set oldProps to properties of PDF export preferences -- store, to restore later
set properties of PDF export preferences to newProps
export document 1 format PDF type to MyFile without showing options
set properties of PDF export preferences to oldProps
Hey, guys. I believe that ICC profile inclusion will cause the resulting PDF to not strictly conform to the PDF/X specification. If using this professionally, you might want to create a preset with another name so as not to get it confused with the default version that meets the standard.
Just another question … how can i tell indesign wich icc profile i must use ? (called ‘workspace’ in english ?)
In your code it seems to take le last selected one (in the top menu “edit / colors…”)
I personally prefer to not use the presets and set all of the export settings in the applescript.
Since I am posting I figured I would include some code I have to check for missing/modified images as well as overset text, in case anyone can benefit from it:
tell application "Adobe InDesign CS4"
tell active document
--First check if there are missing or modified images
if (count of ((links whose status is not normal) as list)) > 0 then
with timeout of 9999 seconds
set Respond2Error to the button returned of (display dialog "Warning! You are trying to create a PDF when there are missing or modified images." buttons {"Print Anyway", "Skip"} default button 1 with icon 1 giving up after 9990)
end timeout
if Respond2Error is "Skip" then return
end if
--Check if there are any text boxes with overset text
set thereIsTextOverflow to ((overflows of parent story of every text frame) contains true)
if thereIsTextOverflow then
with timeout of 9999 seconds
set Respond2Error to the button returned of (display dialog "Warning! You are trying to create a PDF when there are text boxes with text overflow." buttons {"Print Anyway", "Skip"} default button 1 with icon 1 giving up after 9990)
end timeout
if Respond2Error is "Skip" then return
end if
end tell
tell PDF export preferences
set include slug with PDF to true
set use document bleed with PDF to true
set crop marks to true
set page information marks to true
set page marks offset to "0.125\""
set printer mark weight to p25pt
set acrobat compatibility to acrobat 4
set standards compliance to PDFX1a2001 standard --none/PDFX1a2001 standard/PDFX32002 standard/PDFX1a2003 standard/PDFX32003 standard/PDFX42007 standard
set applied flattener preset to "[High Resolution]"
set bleed marks to false
set color bars to false
set compress text and line art to true
set compression type to Compress Objects
set crop images to frames to true
set export guides and grids to false
set export layers to false
set export nonprinting objects to false
set export reader spreads to false
set export which layers to export visible printable layers
set generate thumbnails to false
set ignore spread overrides to false
set include bookmarks to false
set include hyperlinks to true
set include ICC profiles to Include All --Include None/Include All/Include Tagged/Include RGB And Tagged
set include structure to false
set interactive elements to false
set omit bitmaps to false
set omit EPS to false
set omit PDF to false
set optimize PDF to true
set page range to all pages
set PDF color space to unchanged color space --RGB/CMYK/unchanged color space/Repurpose RGB/Repurpose CMYK
set PDF destination profile to use no profile
set PDF X profile to use no profile
set registration marks to false
set simulate overprint to false
set subset fonts below to 0
set use security to false
set view JDF to false
set view PDF to false
--Set color compression settings to high res
set color bitmap compression to auto compression
set color bitmap quality to maximum --minimum/low/medium/high/maximum/four bit/eight bit
set color bitmap sampling to bicubic downsample
set color bitmap sampling DPI to 300
set threshold to compress color to 450
--Set greyscale compression settings to high res
set grayscale bitmap compression to auto compression
set grayscale bitmap quality to maximum
set grayscale bitmap sampling to bicubic downsample
set grayscale bitmap sampling DPI to 300
set threshold to compress gray to 450
--Set bitmap compression to high res
set monochrome bitmap sampling to none
end tell --end of PDF export preferences
with timeout of 1800 seconds
export active document format PDF type to MyFile without showing options
end timeout
end tell
Model: iMac Intel 10.5.8
Browser: Firefox 3.0.2
Operating System: Mac OS X (10.5)
I don’t think there is a way to choose an ICC profile at export. Don’t forget that AppleScript basically automates what you normally would do manually.
If you exported manually is there a way that you choose a profile? I am not seeing that, but correct me if I am wrong.
Unless you change the setting under Edit/Color Settings… before exporting. But that is an Application level setting so you would want to be careful with that. The scripting dictionary has a lot of properties you can set but just to change the main setting would like this (note that this is in the tell application block, NOT the “Tell document” block):
tell application "Adobe InDesign CS4"
tell color settings
set CMS settings to "North America Prepress 2"
end tell
end tell
If you open the InDesign scripting Library and search for color setting, you will see the other options you can set.
the ‘set CMS’ command doesn’t seem to take my icc profile name ! (we have made a profile)
(I see this profile in the Indesign output menu in export window)
All is ok if i make a manual export with my profile, but not with apple script (it doesn’t find my profile name … like other default profiles)