tellapplication"iPhoto" my enabledGUIScripting(true) activate set thePhotos to (getthe selection) aslist repeatwith aPhoto in thePhotos select aPhoto my enhance(aPhoto) endrepeat endtell
on enhance(this_image) tellapplication"System Events" tell process "iPhoto" --key short! keystroke "e" using command down --From UIBrowser click button "Enhance"of group 2of window "iPhoto" keystroke return endtell endtell end enhance
-- Generated by UIBrowser on enabledGUIScripting(switch) tellapplication"System Events" activate-- brings System Events authentication dialog to front set UI elements enabled to switch return UI elements enabled endtell end enabledGUIScripting