I am attempting to write a simple script to click on Apple > Restart... UI Browser app is not helping me much at the moment.
When I click with the UI Browser on the "Restart..." button, it returns it as UI Browser process element and not as MacOS element. So I don't know which process is running that button of the MenuBar and I am therefore unable to trigger it with a script.
I've tried to use the Accessibility Inspector but I can't wrap my head around it.
You need to set the target to something other than UI Browser.app - specifically the app that is responsible for processing the Restartbutton. As I’m not at my desk I can’t tell you what that might be; something like “system events” maybe?
You can use the Target dropdown menu in UI Browser, and find CoreServicesUIAgent.app using the following path: "MacintoshHD:System:Library:CoreServices:CoreServicesUIAgent.app