Blog Archives   RSS/XML
 

Domo Chat  

Priceless Information  

This is Ian's piece of web. See it go. Go, weblog, go! Go travel in Asia. Go study in Tokyo. Go home to Portland. Nah, what the hell. Go, study in Beijing.

Stop. I am a student studying Chinese language in Beijing.

I started this weblog in the Summer of 2002. It keeps following me wherever I go. But, I'm glad to have the company.

Thanks to Clifton for hosting Domodomo. If you need a flash or website designer, you can do no better.

Enter the Domo  

Domoblog - My old Tokyo mobile weblog.

Domo Music - Music I done made. Shockingly presented under the artist name of "Domo Domo."

Exit the Domo  

Upload iPhoto Web Gallery

I wrote a Python/Applescript to automatically export pics from iPhoto to a photo album, ftp the album to a web site, and generate the link code to the new album needed for a blog post -- all with one click.

My parents just left on an RV trip around the western United States, and wanted a way to post photos from the road (I guess most rv camps have wifi now!). We are mac users, so they use iPhoto. I like the simple look of iPhoto's export to web album feature, but exporting and ftp'ing is a drag. So this program just automates the process. Once you have edited the source file with your ftp info, it's all automatic.

This has only been tested on iPhoto 4 and OSX 10.3 Panther (that's all we got). It uses (evil) GUI scripting extensively, because there's no script support for exporting to web photos in iPhoto (lame, btw).

This script does many applescript things, but is written in Python. It requires Appscript to run.

To run it, I suggest writing a shellscript with something like this:
pythonw ~/documents/yourscriptfolder/iphoto_to_web.py;exit
and name the file Export_Iphoto.command. The ".command" at the end will let you double click the shell script.

One more gotcha. Cause I was a lazy script-writer, you will need to make a folder in your "Pictures" folder called "iphoto_webgallery" or the script won't work.

Once you have that all setup, select an album in the left pane of iPhoto and run the script. That should be it (god willing).

The script: iphoto_to_web.py

Comments:

This is awesome! Ever since I forced my wife onto the Mac and iPhoto, she has been griping about how many steps she's got to export photos into an album and transfer to our webdav server (where the album.zip is picked up by another application). On the old PC, I had shell scripts doing all this work. Taking your idea, I could return her one-click convenience of getting new photos onto our family web site.

So python has built-in support for apple GUI objects?

By Eric, at 2:40 AM  


Hmm, think I'm pretty late in responding to this comment.

Anyway, wonder if you ever got a chance to try the script?

Python does not have built-in support for apple GUI scripting, but there is a package you can get called 'appscript' that does. It supports normal applescript, and in addition to that GUI scripting via the accessibility api.

By Ian, at 12:23 AM  


I'm also a fan of appscript, but the lack of scripting support in iPhoto made appscript solutions really fragile in my experience. I wanted to do something similar to your goal -- upload photos to my website -- but instead of using an external script I wrote a generic iPhoto export plugin called ScriptExport. You can look it up on MacUpdate or get it from my website: http://www.n8gray.org/code/scriptexport

Note that it requires iPhoto 5 or newer, so you're probably out of luck if you still haven't upgraded iPhoto. OTOH, the source is available and I'm happy to accept compatibility patches.

By Nate, at 3:46 AM  


Post a Comment

Discuss(3)
Posted by Ian at 6/09/2005 02:23:00 AM    Permalink