【问题标题】:How could I use applescript to play keynote slids?如何使用 applescript 播放主题幻灯片?
【发布时间】:2021-06-17 13:56:53
【问题描述】:

大家

我尝试使用 applescript 播放我的主题幻灯片,但出现错误

set thisFile to "/Users/usrname/Desktop/cardtest.key"
tell application "Keynote"
    activate
    open thisFile
    start thisFile from the first slide of thisFile
end tell

此代码将成功打开主题文件,但无法运行幻灯片。

错误是主题错误:不能让“路径”变成类型“文档”。

我尝试使用:

tell slideshow 1

但另一个错误:幻灯片应该是句子的结尾,不应该有 1。

不知道为什么。

【问题讨论】:

    标签: applescript keynote


    【解决方案1】:

    您将转到start POSIX 路径而不是 Keynote 文档。

    这正是错误告诉您的内容。

    你必须使用对打开文档的引用

    set thisFile to "/Users/usrname/Desktop/cardtest.key"
    tell application "Keynote"
        activate
        set currentDocument to open thisFile
        tell currentDocument to start from first slide
    end tell
    

    【讨论】:

    猜你喜欢
    • 2015-12-01
    • 2021-10-04
    • 1970-01-01
    • 1970-01-01
    • 2012-04-10
    • 2013-11-24
    • 2012-04-07
    • 1970-01-01
    • 2013-08-25
    相关资源
    最近更新 更多