2007: J F M A M J J A S O N D
2008: J F M A M J J A S O N D
2009: J F M A M J J A S O N D
2010: J F M A M J J A S O N D
2011: J F M A M J J A S O N D
2012: J F M A M J J A S O N D

Integrating Sparrow and Aperture

from 2012/04/13

In my recent quest to take on digital photography, I've been using Apple's Aperture to store download my pictures and do basic manipulation on them. It's been working great, except that emailing is a pain because Apple hardcoded the email clients to:

  • Apple Mail.app

  • Eudora (really!?)

  • America Online(!?!)

  • Microsoft Entourage

  • Microsoft Outlook while I'd prefer to use Sparrow, a lightweight client that Sharvil got me hookde on a while back. Rather than continue to use Mail.app to send pictures via email, I found out that Aperture actually uses some AppleScripts to do the actual sending of the email. That got me thinking: I just need to change the script to mail using Sparrow, instead of Mail.

So all I needed to do is replace /Applications/Aperture.app/Content/PlugIns/Mail.applescript with the following script:

-- Mail from Sparrow.app instead of Mail.app
-- Travis Johnson (traviscj@traviscj.com)
on mail_images(email_subject, default_address, image_count, new_files, new_captions, new_comments, cancel_string)
	try
		tell application "Sparrow"
			activate
			set theMessage to make new outgoing message with properties {subject:email_subject, content:"Check out my sweet pictures!"}
			tell theMessage
				repeat with image_idx from 1 to image_count
					set this_imagefile to item image_idx of new_files
					set attachmentfilename to POSIX file this_imagefile
					make new mail attachment with properties {filename:attachmentfilename as alias}
				end repeat
				compose
			end tell

		end tell
	on error error_message number error_number
		log error_message & " " & error_number
		if the error_number is not -128 then
			tell application "Finder"
				beep
				display dialog error_message buttons {cancel_string} default button 1
			end tell
		end if
	end try
end mail_images

Now, magically, I can press the 'Email’ button in Aperture, and Sparrow pops up with a new email, and the proper file attached! Hooray!

I looked into doing the same thing with iPhoto; a slightly different proceedure is needed here. I opened /Applications/iPhoto.app/Contents/Resources/Scripts/Mail.scpt with Script Editor via the terminal:

$ open /Applications/iPhoto.app/Contents/Resources/Scripts/Mail.scpt

then pasted in the above code, clicked 'Compile’, then 'Save’. iPhoto then worked as expected, opening a new Sparrow message with the files attached.

older newer

Powered by Olark