Click system dialogue button not working?

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:

For whatever reason, the system will not sense the button at all. Here's a screenshot of the notification:
image

Also, I have a screenshot of the accessibility inspector (I was thinking of doing UI scripting, but I'm terrible at it:

I could definitely just do a bunch of keystrokes, but that's slower and less accurate (pause time, etc.). I'd also rather not do found image either.

Any suggestions?

Hey @Jackson,

Is there a reliable way to make Shortcat crash?

If I can get it to crash on my system, I’ll help you write the UI-Script.

-Chris

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.

The name of the process throwing up the dialog. I'm guessing this will be Problem Reporter, but it's best to be sure.

Use version 1.5 of my window analysis tool.

Make sure the problem-reporter window is frontmost, and run the macro to create a comprehensive report on it.

From there we can likely figure out how to access the button.

Look at the thread where my window analysis tool is posted.

I've posted extensively on using System Events on this forum.

There is NOT a good manual for UI-Scripting ANYWHERE.

But there are knowledgable folks on this forum, on the Applescript Users List, MacScripter.net, and on UI Browser User's List.

-Chris

1 Like

Thank you! Well, it still hasn’t crashed yet - can’t be sure if this is good or bad. But if it does, I’ll let you know.

1 Like

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!

Hey @Jackson,

Did you click on the ShortCat quit unexpectedly window to make sure it was frontmost, before you ran the Window Analysis Tool macro?

-Chris

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.)

1 Like

@ccstone: I did. I don’t know what’s up with it – I tried it multiple times.

@Tom: thanks! I’ll take a look

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.

2 Likes