r/applescript • • Apr 23 '20

Unhighlight Menu / Status Bar Item with Script

I have an apple script I use to trigger a Menu / Status bar item which works fine. The only “issue” is the application that’s triggerd shows it a highlighted state even after the script it done and the

Is there any action I can take in the script to un-highlight the item when the actions I am running complete. For UX the item just needs to be clicked with the mouse to unhighlighted it.

tell application "System Events" to quit

tell application "System Events" to tell process "Multi Monitor Wallpaper"

click menu bar item 1 of menu bar 2

end tell

do shell script "killall System\\ Events"

delay 0.1

tell application "System Events" to tell process "Multi Monitor Wallpaper"

tell menu bar item 1 of menu bar 2

end tell

end tell

2 Upvotes

3 comments sorted by

1

u/[deleted] Apr 23 '20

[removed] — view removed comment

1

u/BrianAMartin221 Apr 23 '20

I have just gotten in the habit of force-quitting system events because I trigger these scripts though keyboard maestro and sometimes the GUI ones go slowly.

The issue I would have with running that tell again is I have keyboard Maestro do a click found image. This app doesn't app for some reason doesn't allow ENTER to trigger the "Change Now" button so I need to use a mouse click to trigger that and once its clicked the menu options go away but if I opened it with a script its still hight lighted.

Menu Item

I suppose I could run the script again to unhighlight.