So I have this macro. A program will randomly quit on me (was in development, but they stopped). Unfortunately, I can't stop using the program. Whenever it quits, two messages pop up and I'd like them to be closed and have the app be reopened. So I was trying to do the following script:
Thank you @ccstone ! Unfortunately, repetitive use is the only way I’ve found. I do recommend the program, however, it’s pretty good - even though it’s been discontinued.
If it crashes, what helpful information can I send to you?
Also, do you have any recommendations on places to learn UI scripting. I was pretty confused when I looked at the apple pages, but maybe I was in the wrong part.
It just crashed and I got very excited. Strangely enough, it refused to analyze Shortcat and kept analyzing the last window. I suspect that means that it's not officially a window or something, which would probably be why KM refuses to respond. Well, I can post the dialogue later if you want, but I'm highly suspecting that it's not going to help. Thanks for the help anyway!
As @ccstone has said, there doesn’t seem to be a good manual, but as short and concise introduction I recommend this article:
In the examples he is using Apple’s Accessibility Inspector, but the provided information is also valable for other tools/strategies.
(The Accessibility Inspector link in the article is outdated. Nowadays you find Accessibility Inspector as part of Xcode in /Applications/Xcode.app/Contents/Applications/Accessibility Inspector.app. Do not download any old versions which still can be found on the net, including Apple’s own dev pages.)
In addition to what @ccstone and @tom suggested, I have found the Script Debugger to be a great tool for exploring the UI of an app. Start with one of @ccstone's UI AppleScripts, and explore the UI elements that are retrieved.
BTW, if you don't already own SD, you can download a free 30-day trial, and then if you decide not to buy (but I highly recommend that you do buy), it will gracefully downgrade to SD Lite, which is totally free.