Applescript 用于页面的apple脚本及其实现

Applescript 用于页面的apple脚本及其实现,applescript,Applescript,如何将applescript写入pages'09。我正在寻找一个脚本来实现正文的行距。我写的程序 tell application "Macintosh HD:Applications:iWork '09:Pages.app" tell Untitled get properties of paragraph styles tell bodytext set properties to justify set

如何将applescript写入pages'09。我正在寻找一个脚本来实现正文的行距。我写的程序

tell application "Macintosh HD:Applications:iWork '09:Pages.app"
    tell Untitled
        get properties of paragraph styles
        tell bodytext
            set properties to justify
            set line spacing to Double
        end tell
    end tell
end tell
给你:

tell application "Macintosh HD:Applications:iWork '09:Pages.app"
    set thisDoc to front document   
    set line spacing of every paragraph style of thisDoc to 200
end tell
行距
的值以百分比表示,因此
200
将导致双倍行距

编辑:但是,这将设置文档中所有地方的行距,而不仅仅是正文段落。如果只想要它们,请考虑循环并逐一更改它们的段落样式:

    repeat with p in paragraphs of thisDoc
        set line spacing of p's paragraph style to 200
    end repeat