【问题标题】:make applescript close keynote after presentation is over演示结束后让applescript关闭主题演讲
【发布时间】:2013-05-22 12:56:33
【问题描述】:

有谁知道我将如何实现以下目标?

我想让 applescript 在幻灯片放映结束后关闭 Keynote。任何的想法? mybe 通过 keynotes 应用程序属性中的“播放”类? 但我不知道怎么写。

到目前为止我的代码

tell application "Keynote" to open "/Users/bla/Desktop/bla1.key"
delay 3
set var to properties of application "Keynote"
repeat
if var contains "playing:false" then
exit repeat
end if
delay 1
end repeat

do shell script "killall 'Keynote'"

谢谢 :)

【问题讨论】:

    标签: applescript presentation keynote


    【解决方案1】:

    您只需tell app "Keynote" to playing即可访问播放属性:

    tell application "Keynote"
        open "/tmp/temp.key"
    end tell
    tell application "System Events" to tell process "Keynote"
        click button "Play" of tool bar 1 of window 1
    end tell
    tell application "Keynote"
        repeat while playing
            delay 1
            say "a"
        end repeat
    end tell
    say "b"
    

    【讨论】:

    • 天哪,你真是个天才 :) 它奏效了。现在我只需要让两者都循环:) thx
    • repeat 3 times tell application "Keynote" open "/Users/bla/Desktop/1.key" end tell tell application "Keynote" delay 3 repeat while playing delay 1 end repeat end tell tell application "Keynote" to quit delay 1 tell application "Keynote" open "/Users/bla/Desktop/2.key" end tell tell application "Keynote" delay 3 repeat while playing delay 1 end repeat end tell tell application "Keynote" to quit delay 1 end repeat
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-04
    • 2015-07-06
    • 2012-02-24
    • 1970-01-01
    • 2018-10-08
    • 2012-10-22
    • 1970-01-01
    相关资源
    最近更新 更多