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
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.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Scripting "Take Picture..."

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