I have an mac application that once opened (in awakeFromNib
) shows the user an NSAlert
with two buttons, one with "Option1", the other with "Option2". I would like to automate the following flow:
- Open the application from the Applications folder.
- Choose "Option2" by clicking the button in the NSAlert
So far I've managed to do only the first part:
tell application "Finder"
activate
make new Finder window to startup disk
open application file "My Application.app" of folder "Applications" of startup disk
close Finder window 1
end tell
Can anybody help me with the code? I understand that I can use the System Events commands to catch this click event, but can't manage to find any help online for clicking a button in an NSAlert, and not in a regular Window.