Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua

Home Page:http://www.hammerspoon.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hs.menubar, is it possible to add .find()?

agzam opened this issue · comments

I'm surprised that hs.menubar doesn't have a method for finding and referring to existing items. There seems to be no way of getting back to a newly created menubar item without storing the reference to the object.

As in, you basically want a getMenu, in addition to setMenu?

I feel like this might be an older module, where newer modules wouldn't have specific "get" and "set" methods, and rather just have a single menu() method which can both get and set.

nevermind, I just realized - there's http://www.hammerspoon.org/docs/hs.application.html#findMenuItem

Apologies for the noise.

Ah, no. I was wrong. findMenuItem still doesn't return the menuBarItem object. There's still no way of e.g., deleting an existing menu item.