Applescript 检测 Keynote 中显示的幻灯片

发布于 2024-12-24 16:58:33 字数 809 浏览 5 评论 0原文

正如标题所说—— 有没有办法检测主题演讲中显示的幻灯片(使用 applescript)? 是的,我知道如何使用 applescript 更改幻灯片,我只需要检测哪张幻灯片已经处于活动状态。

解决了! >>>>>见下文

(没有足够的声誉来回答我自己的问题,所以我就将其放在这里。)

由于这个人的脚本,我找到了解决方法:http://code.google.com/p/keynotetweet/

对于 Keynote 中的每张幻灯片,您都可以选择附加不可见注释(不是黄色便签,它是底部的文本框将页面视图更改为“显示演示者注释”)。这里你可以存储一个触发字符串,即“action”。因此,创建一个主题演讲并将“行动”放在一张幻灯片的注释中。启动 applescript,然后启动幻灯片,当注释中带有“操作”的幻灯片可见时,applescript 将拾取它并执行您设置的任何操作。

repeat
    tell application "Keynote"
        set slideNotes to get notes of current slide of first slideshow
        if text of slideNotes is equal to "action" then
            say "Is this the slide you're looking for?"
        end if
    end tell
end repeat

享受!

As the title says-
Is there a way to detect what slide is showing in a keynote presentation (using applescript)?
And yes, I am aware of how to change slides with applescript, I just need to detect what slide is already active.

SOLVED! >>> SEE BELOW

(Don't have enough reputation to answer my own question, so I'll just stick it here.)

I found a way round it thanks to this guy's script: http://code.google.com/p/keynotetweet/

For each slide in Keynote you get the option to attach invisible notes (not the yellow stickies, its a text box at the bottom of the page. Change the view to "Show Presenter Notes"). Here you can store a trigger string, ie "action". So create a keynote and put "action" in the notes of one slide. Start up the applescript then the slideshow, and when the slide with "action" in the notes is visible, the applescript will pick up it up and do whatever you set it to do.

repeat
    tell application "Keynote"
        set slideNotes to get notes of current slide of first slideshow
        if text of slideNotes is equal to "action" then
            say "Is this the slide you're looking for?"
        end if
    end tell
end repeat

Enjoy!

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

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

发布评论

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

评论(1

夜光 2024-12-31 16:58:33
tell application "Keynote"
tell slideshow 1
    get current slide
end tell
end tell

给你
应用程序“Keynote”的文档“Untitled”的幻灯片 3

tell application "Keynote"
tell slideshow 1
    get current slide
end tell
end tell

gives you
slide 3 of document "Untitled" of application "Keynote"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文