We have upgraded from ID CS6 to ID CreativeCloud. Of course nothing is easy.
I have a script that imports three PDF files. In CS6 it works correctly, but in CC the PDFs are now being centered in the graphic boxes instead of aligning to the top. Any thoughts? Here is the code:
tell application "Finder"
set volume_ to "G1"
if (list disks) does not contain volume_ then
mount volume "smb://graphics101/G1"
--display dialog "volume is now mounted"
else
--display dialog "volume is already mounted"
end if
end tell
tell application "Adobe InDesign CC 2014"
activate
set myRotateMatrix to make transformation matrix with properties {counterclockwise rotation angle:270}
set myKTRotateMatrix to make transformation matrix with properties {counterclockwise rotation angle:180}
set my_dialog_result to display dialog "Job Number?" default answer "" buttons {"Branded", "Generic", "cancel"} default button "Branded"
set button_returned to the button returned of my_dialog_result
set JobNum to the text returned of my_dialog_result
set MyDestFolder to "G1:CentralPDFProofs:" & JobNum & ":"
set MyArtPDF to "G1:CentralPDFProofs:" & JobNum & ":" & JobNum & "art.pdf"
set MyBCPDF to "G1:CentralPDFProofs:" & JobNum & ":" & JobNum & "bc.pdf"
set MySheetPDF to "G1:CentralPDFProofs:" & JobNum & ":" & JobNum & "sheet.pdf"
try
tell application "Finder"
set MyJobFolder to (name of 1st folder of folder "G1:Art Department 2:Work Files2:" whose name begins with JobNum) as string
set myDestFile to "G1:Art Department 2:Work Files2:" & MyJobFolder & ":" & JobNum & "proof.indd"
end tell
on error
set my_lost_folder to display dialog "Crap, I can't find that folder. Should I put this in the PDF folder?"
tell application "Finder"
set MyJobFolder to (name of 1st folder of folder "G1:CentralPDFProofs:" whose name begins with JobNum) as string
set myDestFile to "G1:CentralPDFProofs:" & MyJobFolder & ":" & JobNum & "proof.indd"
end tell
end try
if button_returned = "branded" then
open file "macintosh HD:Users:DAVID:Desktop:PDF-VIDS.indt"
else
open file "macintosh HD:Users:DAVID:Desktop:PDF-GENERIC.indt"
end if
tell document 1 to set view preferences's ruler origin to page origin
set rulerOrigin to ruler origin of view preferences
if rulerOrigin is not page origin then set ruler origin of view preferences to page origin --(spread origin/page origin/spine origin)
tell page 1 of document 1
set myBox1 to make rectangle with properties {geometric bounds:{0.1, 0.1, 4, 8.4}, stroke weight:"0"}
tell myBox1
try
place file MyArtPDF
on error
display dialog "ART missing"
end try
end tell
end tell
tell page 2 of document 1
set myBox2 to make rectangle with properties {geometric bounds:{0.1, 8.6, 5, 16.9}, stroke weight:"0"}
tell myBox2
try
place file MyBCPDF
on error
display dialog "BC missing"
end try
end tell
end tell
tell document 1 to set view preferences's ruler origin to page origin
tell page 3 of document 1
set myBox3 to make rectangle with properties {geometric bounds:{0, 8.5, 11, 17}, stroke weight:"0"}
tell myBox3
try
place file MySheetPDF
--fit myBox3 given center content
--set absolute rotation angle of contents of myBox3 to 90
on error
display dialog "SHEET missing"
end try
end tell
--display dialog "ok"
--display dialog "ok"
transform myBox3 in page coordinates from center anchor with matrix myRotateMatrix
move myBox3 by {1.25, -1.25}
set geometric bounds of myBox3 to {0, 11, 11, 19.5}
move myBox3 by {-2.5, 0}
--display dialog geometric bounds of myBox3 as string
end tell
--NEW CODE
set MyDup to duplicate myBox3 to page 2 of document 1
tell page 2 of document 1
set geometric bounds of MyDup to {0.44, 0.14, 3.1, 2.85}
move MyDup by {2.5, 5.375}
-- tell MyDup
-- set geometric bounds of MyDup to {5.67, 0.45, 8.36, 12.05}
-- move by {2.5, -0.215}
-- end tell
transform MyDup in page coordinates from center anchor with matrix myKTRotateMatrix
-- set geometric bounds of MyDup to {0, 8.5, 2.5, 11.125}
-- move MyDup to {11.5, 5.5}
-- set rotation angle of MyDup to 180
end tell
tell application "Adobe InDesign CC 2014"
save document 1 to myDestFile
end tell
end tell