Applescript to stop iPhoto Slideshow

I have Applescripts which can start up different iphoto slideshows triggered from iCAL events. They don’t work as I can not stop a slideshow once it starts to switch to another album. In addition I want a slideshow to stop at the end of the day and although my script is triggered it is unsucessful at stopping the slideshow:

– Applescript to shutdown iPhoto Slideshow
try
tell application “Finder”
say “, Slide show, Shutting down” using “Vicki”
end tell
tell application “iPhoto”
activate
stop slideshow
quit “iPhoto”
end tell
on error
say “The Slideshow stop script has had a failure” using “Fred”
end try

Any ideas?

Are you getting an error? What happens in the event log when you run the code from script editor? Can you just kill (the unix command) it?

The slideshow is running, you hear the shutting down spoken part, but the slide show just keeps on running.

If I just have iPhoto running but NO slideshow, the quit of iPhoto works just fine, or a script to run a different slideshow works fine. But once a slideshow starts I can’t get it to quit or another one to start.

I don’t know how to write an applescript to get the terminal to kill iPhoto when the PID is changing. If you can point me in the right direction I will try that.

I realy just want to change slideshows, but if I have to quit iPhoto to do that or kill its process to do that I can use the hammer approach.

Thanks!

Hi,

Maybe you can just do a keystroke. Something like this:

tell app “iPhoto” to activate
tell app “System Events”
tell process “iPhoto”
keystroke space
end tell
end tell

gl,