使用AppleScript将页码放在Pages文档中


3

如何获取每个页面的页码并使用AppleScript将其放在实际页面上?

我知道如何在占位符文本框中放置文本,但我无法弄清楚如何在AppleScript中获取页码。

Answers:


3

页面存储在“页面”中。您可以使用'repeat'迭代它。

tell application "Pages"
    activate
    tell document "Untitled.pages"
        repeat with i from 1 to number of pages
            set thispage to item i of pages
            (* do something
            -- variable i is the page number
            -- variable thispage is the page itself
            *)
        end repeat
    end tell
end tell
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.