0

每个人

我尝试使用 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。

不知道为什么。

4

1 回答 1

0

您将转到startPOSIX 路径而不是 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
于 2021-03-20T10:28:57.453 回答