Hi
I cant really understand this from the documentation but can the "Menu Bar Information" display piped text command similar to applications like this:
or is it only to present a menu of macros?
thx so much in advance
Z
Hi
I cant really understand this from the documentation but can the "Menu Bar Information" display piped text command similar to applications like this:
or is it only to present a menu of macros?
thx so much in advance
Z
Yes, the menu bar itself can display arbitrary text, and the menus within it can display arbitrary text.
Displaying the menu can trigger the contained macros (if they include a Group Status Menu trigger configured to auto-run).
But note that while the menu is held down, Keyboard Maestro Engine is somewhat limited in what it can do, and so any script that is run from an Execute a Shell Script action that is not asynchronous will not complete.
So generally it can display any information that you update periodically, or that you update by clicking on the menu, either in the menu bar, or in the menu (for the latter, you might have to click the menu bar twice to have it updated).
What exactly are you trying to do?
thx @peternlewis!
im trying to pipe in a shell command in my case roon -n -z 'Office-KEF'
that outputs the current playing info like this:
zeltak@IMBP21 ZH_tmp % roon -n -z 'Office-KEF'
Now playing in zone: Office-KEF
Track: "Train"
Artist: "4 Non Blondes"
Album: "Bigger, Better, Faster, More!"
and want to pipe the track and artist section to show in the menu bar as text, ie:
this can update every 5-10 seconds to not tax the system
does that make sense?
thx so much
Z
In that case, just make a macro group and configure it to show a variable in the menu bar.
Then update the variable MyDisplay with the information whenever you want, including potentially with a macro that is triggered every 5 or 10 seconds.
thx! is there an issue with launching the trigger every 5-10 seconds? I dont want to effect other macros or tax the Keyboard Maestro engine.
I had a macro that I ran before every few seconds:
that dramatically effected Keyboard Maestro performance. so im wondering if that would lead to the same behaviour?
thx so much
Z
Keyboard Maestro has quite a rich set of trigger types – not sure how you are changing tracks there, but it might be worth looking for a way of trapping that event.
For a different application (flagging outline focus in Bike Outliner) I started with a periodic trigger, but then realized I could trap window focus changes, and the use of certain related keys (using them as menu bar update triggers, but also passing their usual functions through).
( Trapping a specific set of events can, of course, improve the speed of update, as well as reducing system load )
Example: Needs Focus Indicator - Bike - Hog Bay Software Support
I listen to a lot of Radio Paradise (https://radioparadise.com/home) and I have a macro that fires every 5 seconds that scrapes the player page and extracts the song title & artist, puts it in a global variable and displays it on the menu bar as @peternlewis suggests. It does not seems to impact the performance of my older iMac. I do have some logic that disables the 5 second trigger if I don't have the Radio Paradise web player running.
A periodic 5 second trigger is not ideal, but it wont generally affect performance - unless the actions do.
If the actions were CPU intensive (eg OCR, Found Image, that sort of thing), or heavy on interprocess communication (basically, any UI stuff like looking for buttons or menus), then that can be a different thing.
So it really depends on your script and what your script does as to what the performance implications are.
thx all!
Z
I have a handful of macros that trigger either every 15, 5 or even every second.
15 second triggers include determining the system microphones mute status and updating a Stream Deck button.
5 seconds include using KM tokens to get current song title and artist name from Apple Music app and updating a Stream Deck button.
1 second includes using some JavaScript and Regex to read a stopwatch on a webpage I use for work and updating a Stream Deck button, and another one using AppleScript to get overall length and current position of Apple TV video and updating a Stream Deck button.
All of these macros also have logic built in to disable themselves in case of failure or there’s no media playing, no stopwatch or the app I use to toggle the mic is not running.
None of them adversely affect the KM Engine nor do they bog anything else down on my 2019 iMac. I’ve been using them for quite some time too and there are times where several of them are running a synchronously. So like Peter says it depends on what the macro is designed to do. Your case use is very basic and I imagine the complete macro is very small and quick to execute so I don’t foresee it causing issues.