Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use an AppleScript for iPhoto image export Apps
I use an iPhoto album to keep track of my desktop pictures and have the desktop photo change every time I wake my PowerBook from sleep. After installing iPhoto 5.0.x, the feature of selecting an iPhoto album for use as a desktop picture source is not working very well at all for me.

I still want to use iPhoto to organize my desktop photos, but now I have to export them into a normal filesystem directory and use that in the 'Desktop & Screen Saver' System Preference panel, instead of an album in iPhoto. Every time I add/delete/edit a photo in the album, I have to re-export it.

So, I took a dive into AppleScript. I quickly found out that AppleScript cannot be used to directly export, but I didn't let that stop me. I have thus come up with an AppleScript that exports photos manually for a given album. The album and export directory are hard-coded in the script, but I have noted which lines of code need to be changed if you want to export a different album to a different directory.

Feel free to change the script to prompt the user for album to export and directory to which to export!

[robg adds: This is probably one of the most annoying bugs in iPhoto5, and it took me a while to figure out what was happening: you cannot set an iPhoto5 album to "Change picture every XX minutes" in the Desktop & Screensaver prefs panel. The option is simply grayed out when an iPhoto5 album is selected.

However, if you have albums created under previous versions of iPhoto, the Rotate option is still available, but it only somewhat works. Any images you add to that album in iPhoto5 are simply ignored by the Desktop panel.

So, in short, if you want to have an iPhoto5 album used for a set of rotating desktop images, you'll have to export them first. I hope Apple fixes this one quickly; duplicating hundreds of photos is clearly a waste of drive space and time!]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,251 views]  

Use an AppleScript for iPhoto image export | 8 comments | Create New Account
Click here to return to the 'Use an AppleScript for iPhoto image export' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use an AppleScript for iPhoto image export
Authored by: adrianm on Feb 28, '05 11:44:49AM

I thought this was only broken for smart albums? not fixed ones?

Don't have iPhoto at hand at the moment, so can't say for sure.



[ Reply to This | # ]
Broken for more than just smart albums
Authored by: genericuser on Feb 28, '05 02:51:31PM
Nope, the switch-desktop-photo-every-so-often feature appears to be broken for all albums, not just the smart ones. That's why I wrote the script. Geoff

---
Bugmenot public account

[ Reply to This | # ]

Broken for more than just smart albums
Authored by: vdubya on Feb 28, '05 03:36:33PM

It's not broken. Select the album in iPhoto, and then select the desktop icon (or selection under the Share menu). This will designate the album for use as a rotating desktop picture (if you have more than one picture in the album, of course).

After you've done this, System Preferences should open to Desktop/Screen Saver pane. iPhoto Selection should be hilighted. You can now adjust the parameters for your desktop pictures.

It is silly that you can't just select the album directly, and I'm sure Apple will fix this. However right now it seems you can use iPhoto indirectly to designate albums for desktop picture use.



[ Reply to This | # ]
Broken for more than just smart albums
Authored by: stcanard on Feb 28, '05 04:12:32PM

Not entirely true.

What this does is create a folder with aliases to the images. What this means, though is that if you add a photo to the album it doesn't automatically show up in the desktop rotation -- you still have to remember to add the alias somehow.



[ Reply to This | # ]
Broken for more than just smart albums
Authored by: vdubya on Mar 01, '05 10:23:52AM

After you add the photo to the iPhoto album you are using for desktop images, click on the 'desktop' button again. System preferences will open (and or come to the foreground) and open to the desktop/screen saver pane. You will need to refresh your desktop album selection by selecting something else (like 'Pictures folder'), and then reselecting your 'iPhoto Selection' album. You should then see your new additions listed for your desktop.

This is obviously not an elegant way to do this. It's like Apple was trying to simplify the functionality, and didn't finish the job.



[ Reply to This | # ]
dont duplicate, link them
Authored by: SOX on Feb 28, '05 06:10:08PM

Instead of duplicating the files just link them using the unix command "ln". this will not physically duplicate the files. But you can treat the linked copies as though they were copies.



[ Reply to This | # ]
Link-instead-of-duplicate code change
Authored by: genericuser on Mar 02, '05 11:31:39PM
Yes, you are absolutely right, creating symbolic links will potentially save a lot of disk space (it's a function of how many images you use as rotating desktop photos). I was so focused on simply replicating the iPhoto Export functionality that I didn't even think to do something smarter and use symlinks.

At first I tried making regular, good ol' aliases with the script since that is the Mac way of doing things. I thought the Desktop System Preference would thus be happier with aliases than with symlinks, but oh boy was I wrong! Aliases didn't work at all. So, change this line:
do shell script "cp " & quoted form of image_path & " " & quoted form of target_dir_path
to this:
do shell script "ln -s " & quoted form of image_path & " " & quoted form of target_dir_path
in order to have a folder full of symlinks instead of copies of all the image files.

-Geoff

---
Bugmenot public account

[ Reply to This | # ]

Use an AppleScript for iPhoto image export
Authored by: proffesor on Mar 01, '05 11:17:16AM
Hey there, I wrote a perl script to automate the generation of alias folders for all albums. You can see it in the forums: iPhoto 5 Albums for Rotating Backgrounds? It does have a few requirements: expat and XML::Parser But it seems to work. It restores iPhoto 4-like functionality. The catch is that you have to run it each time you update your albums. (this could be done in cron though) -Seth

[ Reply to This | # ]