Work in progress and alpha features

I think I might finally have been able to reproduce this. Could you check whether it works for you in the latest alpha? (it will still show unescaped in the result view because that view removes the backslashes, but it should be correct now...)

Made good progress on scriptable menubar items today. They pretty much work like Touch Bar script widgets.
Alpha should be available sometime tomorrow.

5 Likes

That's great news! I've been looking forward to this since the feature was introduced. Does it also include a way to create native submenu options? I think that'd be a game changer as a few of common menubar utilities can then be replicated using one app which also reduces resource consumption (hopefully).

As I haven't finished a UI for creating custom menus yet it will only contain a hacky way to create such menus (including submenus) at first.

You will be able to enter a list of named triggers that will be shown in a native menu. I'll improve that with one of the upcoming versions.

Thanks!

May I suggest one addition since you've not started working on it? Perhaps, have a box where we can paste UUIDs as a list and it would create a menu triggering those actions. This way all our existing gestures could have a way of triggering through the menubar as well. Otherwise, I've had to create many named triggers just so I can use it somewhere else. The list could also support indentation to create submenus. Then later when you have an interface, you can add extra options like list item name, icon, toggle checkmarks, etc.

Good idea!

1 Like

@Andreas_Hegenberg

You could add a new input method (e.g. touch bar, midi etc) and replace the 3-col layout for the menubar icons input as follows:

2nd Column: Menubar Icons
3rd Column: Actions

Menubar items are made like a group item, so inside you could add submenus.

maybe add an "new submenu" option for nested submenus

To assign actions to the menu itself you can add actions with the first column selected, or ifthat's too hard add a named trigger dropdown in the first column's inspector e.g.
right click: [open menu / named trigger]
left click: [open menu / named trigger]

I will probably do it in the second column, similar to triggers groups. (You add the predefined action "Show Context Menu", this then behaves like a folder and can be double-clicked to enter a submenu). However I first need to add the logic to supported nested groups (also for normal groups).

I'm uploading 3.381 alpha now which contains a first basic implementation of scriptable menu items. To show a context menu assign the "Show Custom Context Menu" action like here:

It does not yet support sub-menus though.

To change the position of menubar items, drag them directly in the menubar holding cmd

1 Like

I Really like it! Was waiting for this so bad! :smiley:
Big thanks also that it keeps in mind where it had been placed in the menu bar before BTT was quit :+1:t4:
This being said, is there any way you are aware of to lower the interline? In my screenshot I display the Battery percentage and remaining battery time next to the battery, and in order to make it fit in high I have to set it to font size 9 (!) which is quite tiny… Any idea on how to squeeze it up to maybe 10 or 11 like MenuMeters next to it? I honestly don't know if this is up to you or if I can modify this in the Apple Script?

I think I need to add a line spacing property to the configuration. I'll look into that.

1 Like

And here comes a virtual Thank You Beer :smiley: :beers:
That would be totally awesome :heart_eyes: I love that tool :smiley:

3.382 adds some more options:

Unfortunately it's a bit trial & error to get the right values for line height & top margin, the status item behaves a bit strange.

1 Like

You made my day!!! Gonna Test this as soon as I'm back on the Laptop :man_technologist:

Looks great so far! I see that you used my idea, whether it came after you had implemented or before doesn't matter. I am happy.

A few thoughts:

  1. While I'm still unsure of how I'd use it, I tested the current implementation to replicate my COVID-19 TouchBar setup on the menubar. I like that I can set the font colour and background colour. Also like that I can name the item instead of using the default existing one. I think it's a bug though that when naming the item, sometimes it fails to trigger. I tried with the built-in play/pause TB widget and it works with just the UUID but if I rename it, nothing happens on click.
  2. I was wondering if it'd be possible to have the names be generated from the output of a script? For example, in my COVID-19 TB, I've an AppleScript widget that shows total cases and opening it shows multiple script widgets with other numbers. I was hoping to replicate something like this in the menu bar so I am not using a lot of CPU. The menu item should show one result, and context menu items automatically run the script and display the name as the result of the script. I think that'd be mighty useful for other things to track status of things that can be fetched using shell scripts for example.
  3. I ran into another bug, don't know if its new in this version or not. Using the Applescript/Javascript Menubar icon, when I switch between the Config/Common tabs, the sidebar resizes. It's weird.
  4. Also another suggestion or bug that has been in many versions but hasn't been much of a bother until today I realised. I was switching between TB and Named triggers back and forth to create the menu. If I am inside a folder in the TB section, then switching to Named triggers (or any other section really) doesn't show that section's triggers until I hit the back button.
  5. Also, the icon seems to have an issue with the item. An icon I set for testing persists even after resetting both the icon and alternate icon OR even after setting a new icon. It disappears after a second or two but always shows up when the script is refreshing.
  6. Also, appreciate that the Show Custom Context Menu is available to other triggers as well. I can think of using it for many cases like switching audio devices (which I do now with duplicate triggers which shows using BTT context menu or perhaps even a quick bookmark for most used utilities always available anywhere. I know people are using the web view to create dashboards but a simple native menu works for almost all cases and seems much faster and robust I think. I should invest some time now I think and create a lot of Named Triggers. A lot!

Sorry if the message went too long. I am just excited with this update and had a lot of ideas. Great work like always, thanks!

I discovered something! I tried using the UUID of a menubar item created as before in another show custom context menu item and lo and behold! it loads that menu! So it seems like it works as a sub menu except for the fact that the parent menu is hidden and there's no way to go back to it but I think it could be useful as well to create triggers that show another menu!

I'll look into your suggestions & bugs tomorrow!

Haha interesting idea to trigger context menus from context menus - however I think it will be easier as soon as I have finished submemu support (going with indentation to create them for now)

1, 4 and maybe 5 should be fixed in 3.383

For 2: This would basically require the same script runner functionality to generate context menus. I like that idea, but this might take a bit. (Could be done using some hacky scripts updating named triggers, but that's probably not a good idea)

Can confirm 1 & 4 are fixed. Even 3 is fixed, wonder if it was intentional.

5 seems to be fixed as far as the persistence goes but the icon now shows behind my text. It shows fine in context menu but not as a menu bar item itself. I've used a context menu item for the same menu here in the example so you can see the icon shows properly there.

Also I realised that upon clicking the menu item which highlights it in blue, the font colour doesn't invert but the icon colour does, which is standard behaviour across all menubar items (at least the native ones) The font inverting works fine in the context menu though. This also becomes an issue when dark mode switches on as the colour remains the same instead of switching. Perhaps have another colour setting for dark/light modes which will also reflect when clicking on the item?

Catching up with this and learning about the menu bar item stuff! This is awesome. Is it possible to keep the changelogs updated? Sometimes I can’t keep up with this thread. Even a small sentence about what was done in the new build would be appreciated so I’m aware of new features as soon as they start development :smiley:

I’m keeping the stable release notes updated (you can access them via the menubar menu), alpha only sometimes :wink: