Get a Quick Notification a Macro Ran in the Menu Bar With Menu Bar Programs (Textbar, Bitbar)

Is it possible to do such a thing? To be honest I'm more interesting in figuring out how to do this in bettertouchtool, not because I don't like km, but because that's where my km shortcuts run through, but that forum is tumbleweeds.

I saw this thread about similar from 2016

I didn't understand much of what was written because I don't understand code, and bitbar seems to be not maintained anymore, taken over by textbar, but they are similar programs I think, both work from executing shell script, any clues of where to start appreciated.

Hey there. Glad to help if I can.


Re: BitBar vs TextBar — I’ve been a big fan of TextBar, but BitBar (which had been mostly dead, I thought) seems to have had a resurgence. It’s also free. TextBar is only a couple dollars but that’s enough to put people off of it.

Re: BetterTouchTool forum — I’d really like to learn BTT better, but the one question I’ve ever asked on the BTT was basically “What are some cool uses for BTT?” and I basically got no responses. The developer is there, though, so that's cool.


Ok, so… to the question at hand. The issue with both BitBar and TextBar is going to be that they expect to be updating themselves every "X" seconds or minutes. They aren't really intended to be used as a notification system for something like Keyboard Maestro.

Which doesn't mean we can't use it that way, just that we need to get creative about it.

What would really help would be to have at least a basic understanding on what you are trying to do:

  1. What does the macro do or what action do you want it to do?

  2. What is more important: being notified as soon as it ran, or just being able to tell how long it has been since it last ran, or something else?

  3. Do you want that menu bar notification to stick around until the next time it runs? If not, how long should it stay?

  4. I'm assuming that you have some reason for not wanting to just use macOS' notification system. Why is that?

If you can give me/us some more info on what you are trying to accomplish, the chances are greater that we can help.

1 Like

Hi, nice to meet you, glad you found my post about this, I think you're the expert on this, I've asked around elsewhere and no responses, I don't think anyone knows what I'm talking about because it's pretty niche subject.

I thought BitBar was dead, I payed the few dollars for TextBar, I was happy to pay just for the time machine script alone (yours I believe), that is really helpful, I could never really tell what was going on with time machine, was annoying.

Btt is pretty much like keyboard maestro, with less advanced possibilities, but with lots of focus on trackpad, which is useful if you use trackpad to primarily control your mac/macbook, but it can be combined nicely with km.

About the btt forum, majority of posts do not get responses, so your experience was not unique to you, I think I got 1 response out of like 10 questions, it's kind of aggravating, I don't expect response to every post, but why have a forum if nobody hardly uses it, the dev is there and reads but rarely responds, this community is much preferred by me personally.

Anyway, about the TextBar, I don't want it to update every few seconds, I would want it to be a fleeting menu bar notication to confirm that an action (same thing basically as km macro in btt terms), or macro in km, has just occured.

  1. for example, I finetune spotify playlists quickly in the background while watching streaming movies/tv with subtitles or youtube/twitch, (I'm weird I know), by trackpad gestures in btt, some linked to km, for example three finger swipe down will delete a playing song I don't like from current playlist, without leaving the video to go to spotify and do this,

    The problem is I don't know if it went through or not without notification, sometimes it goes through, sometimes it doesn't, the trackpad can be finicky with how you place your fingers, it doesn't always register, at least on my crappy old macbook, btt has a huge ugly hud feature that will notify you of this that an action did indeed go through, but it will distract from the video, but a small menu bar notice will not.

    I watch media not truly full screen but with the menu bar and dock visible anyway, so that's what I'm mostly after, something in the menu bar, if it can not be done individually for specific actions/macros, then there's probably 5 or 6 actions that would be useful to me, the rest I can tell through audio changes and don't need them, if not, then an 'any action/macro notification happened' would be ok I suppose, as long as I see that something went through ok.

  2. being notified as soon as it ran, to confirm it ran.

  3. notify and go away as soon as possible, or a text area can stay in menu bar permanently like some TextBar options have (for example hdd information does), but some small difference will happen to notify in the km/btt text area that something was triggered then go back to default state.

  4. too intrusive, things sliding in and out constantly, I work pretty fast in spotify, but menu bar would not be instrusive.

any other info you want I will gladly provide.

Why not just end the macro in question with the Notification Action?

1 Like

tbh I didn't know that existed, I'll try it out, but that wouldn't work for btt unless I rerouted all my btt actions to run through km, not sure if that's possible.

edit tried it: I've seen that before yeah that's the slide in and out notifier, it would be going frequently, and it hangs around too long, too distracting for me personally.

Don't know if you're still interested, it's kind of a complex thing I suppose what I'm trying to get done, but I asked aorund and recieved 2 interesting ideas, one is involving using console logs, so as to get any information from any app.

This might be doable as my notification doesn't have to anything fancy, just as simple as a check mark or word in response to a console log event, someone suggested the idea to me:

"Theoretically, it’s possible to get a notification of anything if you are monitoring console logs as long as you know what you’re looking for. That could present a number of other issues, however."

The other came straight from TextBar dev who I emailed and he was nice enough to reply back:

"It's possible by using a server on your system and polling for the
notifications with TextBar. TextBar by itself doesn't have a server
capability. If you look at my script on
https://github.com/raguay/TextBarScripts the NotePad script launches a
server and keeps track of the notes. You would need to do something similar."

But that's as far as I can take the idea as I have no scripting knowledge.

Notification Center is definitely going to be your best option for immediate notification (hence the name) but if you don’t like it, you don’t like it…

I haven’t tried using the menu bar for this, so I’m not sure how that would work.

Both BitBar and TextBar are set up that the scripts run every ‘X’ seconds, so I’m not sure how to trigger them “at will”…

It seems to be there was another app that was for the menu bar and might be good for this sort of thing… let me see if I can remember what it was / track it down …

Update:

This is what I was thinking of:

You should be able to integrate this with BTT, have the first action send the command to AnyBar to set the color to red (for example) and then the last action set it to white for example.

If you try to trigger the action and the indicator does not change, then you know it did not register.

I think this is your best option for what you're trying to do if you want to use the menu bar instead of Notification Center.

ok, cool, I will definitely check out AnyBar thanks.

1 Like

awesome, it worked, just added two additional commands (add applescript blocking) events to btt at the end of the action

tell application "AnyBar" to set image name to "blue"

a delay in the middle of 1 second

tell application "AnyBar" to set image name to "white"

saved me a lot of trouble figuring out how to get it done through TextBar, thanks.

edit: coudn't notice that very well, but tweaked it to flash twice with a red explanation mark and I can notice it, now I have some more complex ideas using two other circles, going to harass errrr ask tonsky if they're possible.

Hello @Lon_Ron, you were looking for a way to vitalize an action in the MenuBar. Unfortunately I have no suggestion for you

For KM macros I use the BTT HUD display. This is very helpful for displaying keyboard input to end a "Pause Until". Especially that the HUD display is centered.

You can change the following entries individually:

(1) Title display
(2) Subtitles
(3) Duration until the HUD display disappears (in seconds)
(4) Type of fading out the display 1-4. If 4, the display is faded out to the right.

Here the macro and the AppleScript for it:

HUD Display <269A 200913T135348>.kmmacros (19,0 KB)

2020_09_13_Support_1

tell application "BetterTouchTool"
	trigger_action "{\"BTTPredefinedActionType\": 254, \"BTTHUDActionConfiguration\": \"{\\\"BTTActionHUDDetail\\\":\\\"next\\\",\\\"BTTActionHUDTitle\\\":\\\"Escape\\\",\\\"BTTActionHUDDuration\\\":\\\"1.2\\\",\\\"BTTActionHUDBackground\\\":\\\"38.719535, 38.720697, 38.720067, 213.662109\\\",\\\"BTTActionHUDSlideDirection\\\":4}\"}"
end tell

The Applescript with your changes can of course be integrated into a BTT action. Unfortunately the size of the display (256) cannot be reduced.

2 Likes

hey appleianer nice to talk to you again.

I knew about the btt hud but not that you can customize it, that's cool, I have saved your kmmacros file.

The hud is unfortunately too intrusive to be popping up often for my needs (watching videos and while controlling other things frequently triggering many gestures), but this AnyBar program https://github.com/tonsky/AnyBar seems to be the right way for me.

I got it working by adding this basic AppleScript script after a btt command

    [tell application "AnyBar" to set image name to "exclamation"]

and some delays and repeating and it works well enough to get my attention without distracting me.

AnyDot BTT Notification

I am after two more advanced uses for the program, to monitor my system for specific changes and change colors accordingly (I think will be difficult, don't know if it's possible, I asked dev, and on reddit, I'll try on Stack Overflow (I had a time out ban for some reason) and will likely get downvoted by grouches as usual but I don't care I still ask lol).

Then that should be enough for my workflow, three dot indicators, AnyBar allow many dots, but I can't figure out how to control them through AppleScript, I was wondering if you could take a quick look at the github page and see if there's a way to control secondary and third dots by adding to the AppleScript. Here's relevant section

"You can run several instances of AnyBar as long as they listen on different ports. Use the ANYBAR_PORT environment variable to change the port and open -na to run several instances:

    ANYBAR_PORT=1738 open -na AnyBar
    ANYBAR_PORT=1739 open -na AnyBar
    ANYBAR_PORT=1740 open -na AnyBar

something from there needs to be added to script

    "tell application "AnyBar" to set image name to "exclamation"

to control them individually

because I have three ports open, so three dot, 1738, 1739 and 1740 but it only triggers the left most dot, 1740, regardless of how many are open port with command

    "tell application "AnyBar" to set image name to "exclamation"

I emailed the dev to ask specifics of how it works, but I think he is busy guy with many projects, may not respond, Anyway, any clues/help appreciated as always and hope you are doing well.

Got reply from AnyBar dev, he says he doesn't know AppleScript, so I guess he uses different language, I had assumed AppleScript was standard for this app because it's macOS program,

He recommended polling periodically btt and spotify (what I want to monitor) to get response, and communicating with UDP to control individual instances. hmm, complex.

"How to get other program statuses — no idea. That might require Apple Script, actually :slight_smile:

How to communicate with UDP — check this list https://github.com/tonsky/AnyBar#alternative-clients. Find the language you like and dig into sources. Most languages have UDP in the standard library. This is very basic and simple network protocol."

yea, probably going to have to pay for freelance help for this task, probably python or shell or javascript can do it, but I don't know if AppleScript can easily.

My friend (sttk3com) wrote a JSON version for me. Its easy to edit and you can use "\n" in subtitles.

BetterTouchToolHUDOverlay-JS.kmmacros (2.1 KB)

it was so long ago I forgot what I wanted it for :), but that you for sharing swwwitch I will try it out, any rare code is worth saving.

This still works with the current version of BTT? Is there still a parameter to be specified in the script?

The AppleScript is still working? I get the message: "Missing value".