页面的苹果脚本并在其中实现

发布于 2025-01-07 12:26:41 字数 348 浏览 0 评论 0原文

如何将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

How to bring applescript written into pages'09. I am looking for a script to implement line spacing for the body text.The program I have written.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

開玄 2025-01-14 12:26:41

就是这样:

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

Here you go:

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

The value of line spacing is in percent, thus 200 will result in double line spacing.

EDIT: this, however, would set the line spacing everywhere in the document, not just the body text paragraphs. If you want only them, consider looping through them and changing their paragraph styles one by one:

    repeat with p in paragraphs of thisDoc
        set line spacing of p's paragraph style to 200
    end repeat
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文