For a while I've been wanting to come up with a custom slideshow to include on my desktop. Creating a slideshow is simple with Geektool, but I wanted to be selective about the images I was using.
I wanted to be able to use random images from my iPhoto library, but I store my pictures on a portable drive that I don't typically have attached during the day. So in order to have a slideshow of iPhoto images, I needed to take random images from the library and have them copied to a folder on my laptop.
I have this set up so that once daily (using a Calendar event) the script is run as an app. It opens iPhoto, randomly changes the content of an album called Slideshow, exports the album and closes iPhoto. Note that I got the setup for the albums from post #5 at this link:
http://macscripter.net/viewtopic.php?id=41657
I hope someone can put it to good use.
yeti
I wanted to be able to use random images from my iPhoto library, but I store my pictures on a portable drive that I don't typically have attached during the day. So in order to have a slideshow of iPhoto images, I needed to take random images from the library and have them copied to a folder on my laptop.
I have this set up so that once daily (using a Calendar event) the script is run as an app. It opens iPhoto, randomly changes the content of an album called Slideshow, exports the album and closes iPhoto. Note that I got the setup for the albums from post #5 at this link:
http://macscripter.net/viewtopic.php?id=41657
I hope someone can put it to good use.
Code:
property num_slides : 50
property ss_name : "Slideshow"
property smartf_name : "NotSlideshow"
-- remove every photo from slideshow album
tell application "iPhoto"
set temp_ids to id of every photo of album ss_name
repeat with this_id in temp_ids
remove photo id this_id from album ss_name
end repeat
end tell
-- add num_slides random photos to slideshow album
tell application "iPhoto"
activate
-- get num_slides random photos
repeat num_slides times
set this_id to (id of some photo of album smartf_name)
add photo id this_id to album ss_name
end repeat
end tell
set theDestinationFolder to POSIX file "/Path/to/slideshow" as alias
tell application "Finder"
delete (every item of folder (theDestinationFolder))
end tell
tell application "iPhoto"
set theImagePaths to image path of photos of album "Slideshow"
end tell
repeat with thisPath in theImagePaths
set thisFile to POSIX file thisPath as alias
tell application "Finder" to duplicate thisFile to theDestinationFolder with replacing
end repeat
tell application "iPhoto" to quit
yeti
Last edited: