I have this following code to get my slug box automatically filled out with an applescript:
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
When I run this applescript, it rounds up the decimal number of document size.... For example, for Us letter size, instead writing down 8.5 it will put 9 in.
Does somebody know how to fix that?
I also want my applescript says automatically if the document size is in Inches or Pixels, or centimeters. Thanks for your help!!!!!
Sorry for my english, I am french!