I an using an apple script to fill out automatically my slug box information with the following script:
set mgDate to do shell script "date '+%d/%m/%y'"
tell application "Adobe InDesign CS6"
tell active document
set mgPath to file path as string
set mgName to name
set text item delimiters of AppleScript to ":"
set mgShortName to text item 1 of mgName
set text item delimiters of AppleScript to "_"
set mgClient to text item 3 of mgShortName
set mgCode to text item 1 of mgShortName
set mgTypeDoc to text item 5 of mgShortName
set mgRetailer to text item 4 of mgShortName
set mgJobNumber to text item 2 of mgShortName
set text item delimiters of AppleScript to default
repeat with mgPage from 1 to count pages
set mgWidth to item 4 of bounds of page mgPage
set mgWidth to mgWidth as integer
set mgHeight to item 3 of bounds of page mgPage
set mgHeight to mgHeight as integer
set mgDimensions to ((mgWidth as string) & "x" & mgHeight as string) & "inches"
set active page of layout window 1 to page mgPage
tell active page of layout window 1
try -- check to see that correct SLUG is on the page
set mgFrame to ((text frame 1 of group 1) whose label is "SLUG")
set mgFrame to (text frame 1 whose label is "SLUG")
display dialog "Your SLUG should be in place on every page." & return & return & "(Note : the correct SLUG has been given a script label to help with automation)"
tell table 1 of mgFrame
set contents of cell 2 of row 1 to mgCode
set contents of cell 6 of row 1 to mgClient
set contents of cell 4 of row 1 to mgDate
set contents of cell 8 of row 1 to mgTypeDoc
set contents of cell 2 of row 2 to mgJobNumber
set contents of cell 6 of row 2 to mgRetailer
set contents of cell 8 of row 2 to mgDimensions
set contents of cell 4 of row 3 to mgPage as string
if contents of cell 4 of row 2 is "#" then
set contents of cell 4 of row 2 to "1"
set contents of cell 4 of row 2 to (contents of cell 4 of row 2) + 1 as string
My concern is this script makes the document size values rounded up to the closest decimal. For exemple if I am doing a 8.5x11 in document and I run the script,
I will get 9x11 in in my slug box information. So I am looking for how to get the exact value? How could I also fill out automatically the units? For example, Something i am using Inches and sometimes Pixels.
My actual script just allows to use Inches.... How could I fix that?
Thanks you so much for your help and sorry for my english!