Below is the my script as it stands. It’s not perfect by any stretch of the imagination. Does anyone have suggestions for tidying up the code, or what I may be doing wrong. Thanks
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 CS6"
activate
set my_dialog_result to display dialog "Job Number?" default answer "" buttons {"Branded", "Generic", "cancel"} default button "Generic"
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 myBox to make rectangle with properties {geometric bounds:{0.1, 0.1, 4, 8.4}, stroke weight:"0"}
tell myBox
try
place file MyArtPDF
on error
display dialog "ART missing"
end try
end tell
end tell
tell page 2 of document 1
set myBox to make rectangle with properties {geometric bounds:{0.1, 8.6, 5, 16.9}, stroke weight:"0"}
tell myBox
try
place file MyBCPDF
on error
display dialog "BC missing"
end try
end tell
end tell
tell page 3 of document 1
set myBox to make rectangle with properties {geometric bounds:{0, 8.5, 11, 17}, stroke weight:"0"}
tell myBox
try
place file MySheetPDF
fit myBox given center content
on error
display dialog "SHEET missing"
end try
end tell
end tell
set MyDup to duplicate myBox to page 2 of document 1
tell page 2 of document 1
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 CS6"
save document 1 to myDestFile
end tell
end tell