使用 Apple Script 设置 PowerPoint 字体颜色

发布于 2025-01-12 13:22:37 字数 410 浏览 3 评论 0原文

我正在尝试使用 Apple 脚本来设置所有选定的 PowerPoint 形状的字体颜色。我使用与此类似的东西来设置填充和线条颜色,但我无法让它适用于字体颜色。

tell application "Microsoft PowerPoint"
set theShapeRange to shape range of selection of active window
set n to (count shapes of theShapeRange)
repeat with i from 1 to n
    tell shape i of theShapeRange
        set font color of text range of it to {99, 99, 99}
    end tell
end repeat

结束告诉

I'm trying to use Apple script to set the font color of all selected PowerPoint shapes. I used something similar to this to set fill and line color, but I haven't been able to get it to work for font color.

tell application "Microsoft PowerPoint"
set theShapeRange to shape range of selection of active window
set n to (count shapes of theShapeRange)
repeat with i from 1 to n
    tell shape i of theShapeRange
        set font color of text range of it to {99, 99, 99}
    end tell
end repeat

end tell

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

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

发布评论

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

评论(1

几味少女 2025-01-19 13:22:37

根据莫克曼在上面的评论中提供的指导,这似乎是有效的。

tell application "Microsoft PowerPoint"
    set theShapeRange to shape range of selection of active window
    set n to (count shapes of theShapeRange)
    repeat with i from 1 to n
        tell shape i of theShapeRange
            set font color of font of text range of text frame of it to {99, 99, 99}
        end tell
    end repeat
end tell

Based on the guidance provided by Mockman in a comment above, this seems to work.

tell application "Microsoft PowerPoint"
    set theShapeRange to shape range of selection of active window
    set n to (count shapes of theShapeRange)
    repeat with i from 1 to n
        tell shape i of theShapeRange
            set font color of font of text range of text frame of it to {99, 99, 99}
        end tell
    end repeat
end tell
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文