Custom Menu Bar Icon - New features

Some features I would like to have:

1- New predefined action to show / hide / toggle show-hide any custom menubar icon

2- New predefined action for changing the icon (without changing the execution of predefined action).
Example: Menu Bar Icon that switchs between 2 BTT presets, with this feature:

  • I have a menu bar icon "Left Arrow".
  • When I click this menu bar icon the "Left Arrow" preset is disabled, and the "Right Arrow" preset is enabled
  • Automatically the menu bar icon changes to the icon "Right Arrow", matching the BTT preset that is enabled
  • If I click again on the icon "Right Arrow", the "Right Arow" preset is disabled, and the "Left Arrow" is enabled again. The icon changes again and shows the Left Arrow icon, matching with the preset enabled.
    So, the idea is to have the possibility of having a menu bar icon showing the current state of the action that this icon is executing.

3- Make a menu with options:
Instead of launching an action when clicking a menu bar icon, I would like to have the option of getting a context menu.
The menu would be personalizable with any predefined action of BTT.

I would like to see this also. It's currently possible to have the menu bar icon change based on output from a script, but it would be nice to not have to have the script run every second when it could run on click/menu option.

Hello, can someone explain how the menu bar icon change on a script. Where would the script run and how can the script refer to the Menu Bar Icon. I have an .AppleScript that I would like to execute to have this done.

Thanks

Do you want to switch between two icons, or do you have more than that?
If it's just two icons, you can set the default and an alternate icon in the configuration of the scriptable menubar item:


Then you can just use the "Alternate Color Regex" to activate the alternate icon & colors:

If you need more icons you need to return them either by providing the icon_path, a base64 encoded string containing the icon (icon_data) or the sf_symbols_name in an escaped JSON:

return "{\"text\":\"testTitle\",                                                                                           
\"sf_symbol_name\":\"house\"}"

Andreas,
Thank you for wonderful customer service considering that this is an aged post. I will surely use your instructions to complete the task I have at hand. Essentially, I want the title (text) of the menu to change as I switch between clients to remind me which client I am currently working on. I select my clients from an AppleScript list and hence once they are selected I would like to update the menu title to reflect the name. I think that you pointed me down the right path. If there is any additional insight to this, I would appreciate it, otherwise I will get to work.

Thanks

Not really much more, if you can post an example script (and maybe some example images you'd like to set) I can show you how to do that.