Copy link to clipboard
Copied
Hi all,
Hope somebody could point me in the right direction...
I have a droplet app written in AppleScript. It looks for the page size of the documents dropped and uses that info. Just for testing I have a dialog at the end which returns this.
The problem;
The app only returns the document size, as in the size displayed in the 'Document setup' window. I need to use the actual page size, as a large number of my clients use the page tool to adjust the page sizes. I need it to always use the actual page size.
Has anyone run into a similar problem?
My code is below, thanks in advance for any help
on open mgItems
repeat with mgThisItem in mgItems
tell application id “com.adobe.InDesign”
try
open mgThisItem
tell active document
my get_documentSizes()
tell document preferences
tell document preferences
set overallwidth to page width
set overallHeight to page height
end tell
end tell
end tell
close active document
on error
-- decide what kind of error handling you want to include if the file won’t open
end try
end tell
-- rest of script for email processing here
end repeat
display dialog overallwidth
end open
Copy link to clipboard
Copied
this will return the correct page size, round to closest whole numbers
on open mgItems
repeat with mgThisItem in mgItems
tell application id "com.adobe.InDesign"
try
open mgThisItem
tell active document
set {a, b, c, d} to bounds of page 1
set PG_HEIGHT to round c
set PG_WIDTH to round d
end tell
close active document saving no
display dialog "Height " & PG_HEIGHT & "mm" & " Width " & PG_WIDTH & "mm" as string giving up after 3
on error
-- decide what kind of error handling you want to include if the file won’t open
end try
end tell
-- rest of script for email processing here
end repeat
end open
Copy link to clipboard
Copied
Thanks, managed to plug this code in and use perfectly !
Copy link to clipboard
Copied
Hi Lucas,
did you test the script with a document where the spread view was rotated?
Regards,
Uwe