Since I am terrible at scripting, I had difficulty finding how to assign the transparency flattener preset when exporting an EPS. My guess is that the same id would work when exporting a PDF. I thought I would include this script for others, and maybe somebody could even improve upon it, so it can help others?
This script will export an EPS from the active InDesign document to the folder in which the original resided.
tell application "Adobe InDesign CS2"
if (exists document 1) and (saved of document 1 is true) then
set theDoc to active document
set filePath to file path of document 1 as text
set fileName to name of front document as string
if fileName contains ".indd" then
set aCount to count every character of fileName
set aCount to aCount - 5
set fileName to characters 1 thru aCount of fileName as string
set fileName to word -1 of fileName as string
end if
display dialog fileName
else
display dialog "You must first save the file."
end if
end tell
tell application "Adobe InDesign CS2"
set theDoc to active document
-------------------------
-------------------------
--This will convert all Spots to Process. Probably not necessary, nor preferred in most prepress situations.
try
set convert to process of every ink whose index > 4 to true
end try
-------------------------
-------------------------
tell EPS export preferences
--set applied flattener preset to flattener preset, medium
set origProperties to properties
--It appears to me that low, medium, and high transparency flattener presets can be achieved by using their respective ids of, 110, 111, and 112. For this I am using medium.
try
set applied flattener preset to flattener preset id 111
end try
set properties to {data format:ASCII, PostScript level:level 2, OPI image replacement:false, omit bitmaps:false, omit EPS:false, omit PDF:false, EPS color:CMYK, preview:PICT preview, EPS spreads:true, font embedding:complete, image data:all image data, bleed bottom:0, bleed inside:0, bleed outside:0, bleed top:0}
end tell
export theDoc format EPS type to (filePath & fileName & ".eps") without showing options
set properties of EPS export preferences to origProperties
end tell