Hello all. I have a script that is supposed to:
- Create a blank document
- Place a DCS 2.0 file (multi file DCS 2.0)
- Resize picture box / document to full bleed size of image
- Print out a separated Postscript
Steps 1 thru 3 work fine. Step 4 is inconsistent. Sometimes I get a blank multipage Postscript, other times I get a multi page Postscript with the image. This happens even when testing with the same image over and over.
Any ideas would be appreciated.
Thanks
property therectangle : {0, 0, 1, 1}
set inInputFile to alias "Macintosh HD:Users:peki:Desktop:Archive:ChicagoMag_P1_DCSM.eps"
set inOutputFile to (path to desktop as string) & "test_file.ps"
tell application "Adobe InDesign CS3"
tell view preferences
set horizontal measurement units to inches
set vertical measurement units to inches
end tell
-- Create the original document
make new document with properties {document preferences:{page width:8.5, page height:11}}
-- Create picture box, place picture, resize document and picture box
tell active document
-- Create picture box with generic size
set myRectangle to make rectangle with properties {geometric bounds:therectangle, stroke weight:0}
tell myRectangle to place inInputFile
-- find out true size of placed image
set imageBounds to geometric bounds of EPS 1 of myRectangle
-- resize picture box to fit true size of image
set geometric bounds of myRectangle to imageBounds
-- figure out height and width of picture box
set TheHeight to (item 3 of imageBounds) - (item 1 of imageBounds)
set TheWidth to (item 4 of imageBounds) - (item 2 of imageBounds)
-- resize the page
tell document preferences
set page width to TheWidth
set page height to TheHeight
end tell
-- reposition the image after page resize
set geometric bounds of myRectangle to imageBounds
set geometric bounds of EPS 1 of myRectangle to imageBounds
-- Create the postscript
tell document preferences
set pw to the page width
set ph to the page height
set document slug uniform size to true
set slug top offset to 0
end tell
-- Set up the print preferences, thus not having to use a pre-built preset
tell print preferences
set printer to postscript file
set PPD to "AdobePDF 8.0"
set color output to separations
set trapping to off
try
set bleed chain to true
set bleed top to 0
end try
set use document bleed to print to false
set include slug to print to false
set all printer marks to false
set tile to false
set page position to centered
set print page orientation to portrait
set paper size to custom
set paper height to ph
set paper width to pw
set download PPD fonts to true
set flattener preset name to "[High Resolution]"
set flip to none
set font downloading to complete
set OPI image replacement to false
set PostScript level to level 3
set print layers to visible printable layers
set print nonprinting to false
set print spreads to false
set scale mode to scale width height
set scale height to 100
set scale width to 100
set scale proportional to true
set send image data to all image data
set sequence to all
set print file to inOutputFile
end tell
print without print dialog
end tell
close document 1 saving no
end tell
Model: MacBook Pro 10.5.8
Browser: Firefox 3.5.10
Operating System: Mac OS X (10.5)