Pages

Monday, January 7, 2013

Scripting "Take Picture..."

I am trying to set up a script that will take a picture with a USB connected camera in the other room.

 

I am using Accessibility Inspector and UI scripting it since Image Capture does not have an AppleScript library. 

 

Currently this is my script

 

tell application "System Events"

      tell process "Image Capture"

             tell menu bar 1

                                        tell menu bar item "File"

                                                  tell menu 1

                                                            click button "Take Picture..."

                                                  end tell

                                        end tell

                              end tell

                    end tell

          end tell

 

 

which returns "System Events got an error: Can’t get button "Take Picture..." of menu 1 of menu bar item "File" of menu bar 1 of process "Image Capture".

 

What is weird is that i can plug in "Window" for "File" and "Zoom" for "Take Picture..." and it works perfectly.

I have tried 5 different buttons and they all work with this identical script, but Take Picture will not work. 


View the original article here

0 comments:

Post a Comment