Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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.

iMac, OS X Mountain Lion (10.8.2)

Posted on Jan 7, 2013 1:37 PM

Reply
Question marked as Best reply

Posted on Jan 7, 2013 1:57 PM

If you're doing this to play around wiht GUI scripting in Applescript fine, if you are more interested in the end result check out Automators Take Picture and Take Video Snapshot actions.

6 replies

Jan 7, 2013 2:02 PM in response to Frank Caggiano

This is actually a workaround for using Automator.


I originally had a simple workflow built in Automator that did everything I needed.


However it ended up being really buggy, when the camera went into sleep mode and was revived the script no longer worked until a picture was taken manually in Image Capture. If there is anything I can do to fix that problem it would be a lot easier.

Scripting "Take Picture..."

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.