Is there an apple script that can click on the notification for me so that I don't have to open the app using a mouse?
I plan to bind this script to a keyboard shortcut and that way I can open incoming notifications with just the keyboard.
Here are two notifications type examples
Note that scripts like this wont work because it attempts to click on a button and there's no consistent button to click on to open a notification. Sometimes its top, sometimes its bottom, sometimes its neither.
What is needed is a script that clicks on the "left" part of the notification, that will always open the app.
Best Answer
Testing under macOS High Sierra, the following line of example AppleScript code, when run, had the following general effects on a notification:
Note that with some notifications, they will be dismissed; however, with others, the app will still be opened/focused as applicable but the notification will not be dismissed. These will need to be replied to appropriately.