Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hepcat72

macrumors newbie
Original poster
Apr 23, 2010
14
0
Hi,

I want to create a script that I can assign to a keyboard shortcut that will allow me to add a face to a displayed iPhoto pic. I created an automator workflow that does it, but it takes between 5-10 seconds to run (not the boost in efficiency I was looking for). I wrote a script that I was sure would do it, but while it runs without error, it does't actually add a face. Here's the script. Anyone have any idea why it doesn't work or how to fix it? I had used the Accessibility inspector and an applescript that generates the scripting interface to iPhoto to show me the scriptable elements used in this script:

Code:
tell application "iPhoto"
[INDENT]activate
tell application "System Events"
[INDENT]tell process "iPhoto"
[INDENT]click (static text 2 of window 1)
display dialog "DEBUG: Value of static text: " & (value of static text 2 of window 1)[/INDENT]
end tell[/INDENT]
end tell[/INDENT]
end tell

Incidentally, the debug message shows the string to be "Add a face...".

Thanks,
Rob
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.