Click a menu option - can't figure out hierarchy

I am using Applescript to perform a number of image tasks. I am using my iPhone as the image capture device, however I am using QuickTime Player so I can see what the camera sees before I take the picture. The issue is that I need to close QuickTime Player and re-open it after every so many images.


I have the script accomplishing this right up until the point it displays this menu:


User uploaded file

Now, I need it to automatically select the iPhone. I tried having the script simply use the up / down arrows twice and then push return, that works except that QuickTime likes to switch the order of the selections randomly.


Really, I simply need to know how to get the script to select based on name of the device. I will attach a screen shot of the Accessibility screen for that option as well:


User uploaded file

Perhaps someone with some more UI experience than I can help me?


Thank you in advance!

MacBook Pro, OS X El Capitan (10.11.5)

Posted on Jul 10, 2016 3:19 PM

Reply
1 reply

Jul 11, 2016 8:07 AM in response to AppleScriptQuestions

Having got just one camera, I tried to select “Built-in Input:Line In” instead:

User uploaded file


The following seems to work, although several seconds are needed before you can see the change:


tell application "QuickTime Player"

activate

tell application "System Events"

set theWindow to window 1 of process "QuickTime Player" whose subrole is "AXStandardWindow"

clickbutton 1 of theWindow

keystroke "Built-in Input" & return

end tell

end tell

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.

Click a menu option - can't figure out hierarchy

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