I’m trying to use AppleScript to automate the launching and selecting of files for a tool called CheckMate (a type of XML file validation tool for translators, but not really important for the purposes of this posting).
I can get AS to launch the app, but after CheckMate flashes up for a split second, focus jumps back to the AS editor and none of the steps after launching the app are carried out.
I need AppleScript to click on a button marked Session… which will open a new window where I need to then select “Add” and then have the script exit so I can select the file I need and proceed with using CheckMate.
Here is what I have so far:
tell application "CheckMate" to activate
tell application "System Events"
tell process "CheckMate"
click button "Session..." of window "Untitled - CheckMate"
delay 1
click button "Add..." of window "Session Settings"
end tell
end tell
Not only does this fail to click any of the buttons, but it also hangs the script after CheckMate launches. I close CheckMate, but the script just hangs there for 3-4 minutes before it finally ends and I can try having another go.
I’ve read up all I can on button clicking and it seems very straight forward, so I don’t see where my error is.
I’ve tried using just three periods after “Session” and “Add” (“Session…”, “Add…”) as well as an actual ellipsis character (option key + semicolon), but this doesn’t seem to have helped any.
Can anyone point out where I’ve come off the rails?
Thanks