0

does anyone know how i would achieve the following?

i want to make applescript close Keynote AFTER the slideshow is finished. any idea? mybe via the class "playing" in keynotes application properties? but i dont know hw to write it.

my code so far

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'"

thx :)

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

0

You can access the playing property with just 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"
Lri
  • 26,768
  • 8
  • 84
  • 82
  • omg you are a genius :) it worked . now i only have to get the loop of both going :) thx – Marco Klein May 22 '13 at 15:10
  • `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` – Marco Klein May 22 '13 at 15:21