How can i stop an iPhoto Slideshow with Applescript

I have set up a system with a Mac Mini to boot at 7am and launch an iPhoto slideshow using energy saver schedules and a simple applescript in the login items.

I have also scheduled the machine to shutdown at 1130pm. However, the logout process is cancelled because iPhoto fails to stop the slideshow.

I think the way forward is to write another applscript and use the iCal appointment alarm to launch it 5 mins before the machine is scheduled to shutdown.

However, i cannot get this to work either.

I have enabled the access for assistive devices in Universal access and used commands like :

tell application "iPhoto"
stop slideshow
quit
end tell

and

tell application "iPhoto"
activate
tell application "system events"
keystroke escape key
end tell
quit
end tell


but it still doesn't end the slideshow.

Any help would be gratefully received!

Mac OS X (10.4.9)

Posted on Jul 18, 2007 2:12 AM

Reply
2 replies

Jul 18, 2007 1:54 PM in response to lurchmobile

Hi lurchmobile

"I think the way forward is to write another applscript and use the iCal appointment alarm to launch it 5 mins before the machine is scheduled to shutdown."

Yup, good way to go.

Have iCal launch this script, saved as a run only application, it's pretty heavy duty using "kill", but it's effective.

try
do shell script "killall iPhoto"
end try


slightly softer way to go, you will need to have iPhoto exit out of slide show with this script.

tell application "Finder"
set _App to (name of application processes whose name = "iPhoto")
end tell
repeat with i from 1 to (count of _App)
set _Quit to item i of _App as text
tell application "iPhoto"
tell application _Quit to quit
end tell
end repeat


Budgie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can i stop an iPhoto Slideshow with Applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.