0

I'm running an applescript that adds a page to a document, the "Override All Master Page Items" then import text into one of the released text boxes. The solutions I've found don't seem to work as they reference an active page number

So is it possible to do this?

set theListOfFileNames to {"1", "2", 3", "4", "5", "5"}
set theTargetFolder to ((path to desktop folder) & "Catalogue") as string

repeat with theCurrentFileName in theListOfFileNames
      set theImportFile to theTargetFolder & ":text:" & theCurrentFileName & ".txt"
      tell application "Adobe InDesign CS3"
                     tell active document
   make page
   override (master page items) -- what to do here??
   -- then select any textbox on the page
       -- place theImportFile without showing options
   --end tell
  end tell
  save active document
end tell
end repeat
Tomate
  • 308
  • 1
  • 2
  • 14

1 Answers1

0

Tested in CS6, should work in CS3...

tell application "Adobe InDesign CS6"
    tell active document
        set newpage to make page
        tell newpage
            --setting the next line to a variable will allow you to return the items that were affected --call it whatever you want.... It will be a single item if only one item or a list if multiple items on the page. 
            set theoverride to override (every item of master page items of newpage) destination page newpage
        end tell
    end tell
end tell

return theoverride  ---items of the page that were affected. You will need to reference the correct one and account for single/multiple items.
Lithodora
  • 338
  • 1
  • 13