Apparently Apple does not like to use AppleScript for their own applications. Fed up with iPhoto’s poor performance, I started playing with AppleScript so I could automate some of my tasks. Alas, iPhoto is missing a lot of things, apparently.
I would like to see iPhoto’s AppleScript suite support:
- Film rolls - I can access albums and selections, but not film rolls. What gives?
- Import - I want to choose a bunch of files or directories and tell iPhoto to import them.
- Export - While we are at it, let’s go the other way too.
- Retouching - I can do it in the application, so I should be able to do it programmatically.
What do you want in the iPhoto AppleScript suite?


Not just iPhoto...
It is not just iPhoto that is lacking in the AppleScript department: Preview is just as bad. I use pdflatex to create pdf-files, and when I update a file, I have to close the file in preview, and then open it again, and start looking for the right page. A simple set of AppleScript commands would make this so much easier.
Before suggesting that a simple "Open" from the command-line would suffice: no, it just brings the document to the front, without re-reading the file from disk (thus showing the old version).
Maarten
Why Not Use GUI Scripting?
I know it's not the most elegant solution, but it seem's to me that at least some of your wish list can be accomplished this way (for example, tell iPhoto to display a picture, then press the UI Element for "Retouching").
http://www.apple.com/applescript/uiscripting/
Why Not Use GUI Scripting?
Please don't consider this a flame-bite, it isn't. But the original blog entry touched a nerve with me (see below)
Is that enough of a reason?
iMovie and Keynote
Apple justly brags about how iMovie drives iDVD with applescript, but iMovie seems to have no support itself! When you get done with iPhoto, iMovie would be a logical next step, if only...
And I haven't looked at Keynote but I understand it has no applescript either. Would be nice to use your photos in keynote with its cool transitions. Have to hack the xml keynote format, I guess.
(Stay alive in Iraq and look forward to seeing you at NYC PerlMongers...)
iView MediaPro
iView MediaPro is quite scriptable.
http://www.iview-multimedia.com/
Export Script
I wouldn't be surprised to learn that others have tackled the export process more elegantly, but I cobbled together a script that exports selected images or albums. No resizing, reformatting, etc., just copies of the images.
This was an attempt to work around the fact that iPhoto only burns CDs with a complete iPhoto directory structure. My dad, new to the Mac platform, just wanted a flat collection of photos on a CD to give to a Wintel user. Apple's tech support sent him to a knowledgebase article with a 12-step process for exporting the files and moving them to a CD. A script just made it a bunch easier.
Isn't family a great source of innovation?
http://homepage.mac.com/jonblock/iPhoto%20Export%20Script%200.2.hqx
[Tested only on iPhoto 2]
I'm open to feedback on the script, by the way. You should be able to figure out my address from the url above.
Export Script
Drat. Left out part of the URL.
http://homepage.mac.com/jonblock/Downloads/iPhoto%20Export%20Script%200.2.hqx
Why Not Use GUI Scripting?
GUI scripting is ugly, and it costs money, and people have to install it. I might as well not even develop things for other people to use.
For all the hassle that Apple put into UI scripting, I think they could have made some decent AppleScript libraries for their projects.
Why Not Use GUI Scripting?
I was just reading Matt Neuburg's recently released AppleScript: The Definitive Guide," which is very helpful when it comes to using AppleScript! In it, he suggests:
"If you're reduced to using GUI scripting to accomplish some goal, and if the target application is still being actively developed, then consider writing to the developer and requesting that the application be made genuinely scriptable."
See phaxda | February 23, 2004 08:26 AM