You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Applescript OK button

What do I need to edit this to click the OK button?



display dialog "Say something" buttons {"OK"} default button "OK"

delay 10



Thanks

MacBook Pro Retina

Posted on Jun 3, 2020 9:13 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 3, 2020 9:21 PM

Use:


display dialog "Say something" buttons {"OK"} default button "OK" giving up after 10


Note that if the script checks what button was pressed later, it'll be an empty string instead of "OK".


(181237)

3 replies

Jun 6, 2020 5:53 PM in response to Niel

I am not sure I get your empty string comment!

Virtually 100% of the time the button is NOT pressed. I have noticed that the AppleScript icon will bounce in the dock with the name of this script and then continue on if I press the AppleScript icon in the dock.


Is there a way around this? No buttons and giving up after 10 sec is ok as well so long as the script runs uninterrupted.

Thanks again for your patience.

Applescript OK button

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