iPhoto: Switch library

(thx: Justin S) iPhoto lets you switch libraries when you start it by holding down the option and the shift key. This AppleScriptlet duplicates that key combination. (Requires UI scripting enabled.)

--Switch iPhoto Library
tell application "System Events"
key down option
key down shift
tell application "iPhoto"
activate
tell application "System Events"
key up option
key up shift
delay 1
keystroke return
end tell
end tell
end tell