0

How to close the "Your computer was restarted because of a problem" popup in AppleScript? enter image description here

We use a VM to execute e2e tests and they often fail because of this popup. I would like to programmatically close it.

I tried listing the windows based on https://stackoverflow.com/a/26196136, but the popup is not included in the list

nagy.zsolt.hun
  • 6,292
  • 12
  • 56
  • 95

1 Answers1

1
tell application "System Events"
    tell application process "Diagnostics Reporter"
        if (exists window 1) then click button "Ignore" of window 1
    end tell
end tell
nagy.zsolt.hun
  • 6,292
  • 12
  • 56
  • 95
  • Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - [From Review](/review/low-quality-posts/33713069) – Prolog Jan 26 '23 at 13:16
  • This is the complete answer. – nagy.zsolt.hun Jan 27 '23 at 14:22