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

Applescript click buttons issue

Hello all,


I'm having an issue with a script that will click a button if it is available if not then it is suppose to click another button. See screenshots for an explanation.


The following screenshot shows the script and what it should do. In this case I want the "Cancel" button to be clicked but if you scroll down to my second screenshot you will see that the script is still seeing "Add" as a button.

User uploaded file



I wrote this script to see if the button was being found.

User uploaded file


Any ideas on how I can get around this? Thank you in advance.

MacBook Pro with Retina display, OS X Yosemite (10.10.3)

Posted on Jun 30, 2015 7:14 AM

Reply
3 replies

Jun 30, 2015 10:36 AM in response to Shea2288

I'm not sure I understand your thinking. You're asking for the name of every button - there are three buttons. One of them is 'Add'. The test will always pass because the add button is there.


Instead what I think you really need is the name of every enabled button.


Change your script to:


... set theButtons to name of every button whose enabled is true


and see what you get.

Applescript click buttons issue

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