使用applescript覆盖indesign中的母版页项目

时间:2014-03-21 22:50:23

标签: applescript adobe-indesign

我正在运行一个可以在文档中添加页面的AppleScript," Override All Master Page Items"然后将文本导入其中一个已发布的文本框中。我发现的解决方案似乎无法正常工作,因为它们引用了有效的页码

那么可以这样做吗?

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

1 个答案:

答案 0 :(得分:0)

在CS6中测试,应该在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.