Macro to Toggle Airfoil Satellite Mute - Strange Behavior

When Airfoil Satellite is running, it appears as a system menubar item (i.e., an icon in the main menubar, grouped with others like Sound, Bluetooth, etc., on the right hand side).

I wrote a macro to select the "Mute" item in this menu, which is a toggle (checked = muted, and vice versa).

The odd thing is that when triggered, the macro runs, but its effect is only applied after I manually click the menubar icon for Airfoil Satellite.

In other words, music is playing via Airfoil Satellite, I trigger the macro, music continues to play, I single click the Airfoil Satellite menubar icon, music stops and "Muted" is checked. (Same sequence to unmute.)

Any ideas on how to fix this? Here's what the macro looks like:

Well, I solved my own problem.

Not super elegant; I just mimicked the behavior I described above (effect applied after I click the icon).

So in case anyone else has the same issue, here's my solution (and in the second action, I also selected the "Restore Mouse Location" option from the context menu):

Hey Jeff,

This is because menu bar applets are not proper applications, and there's no way for Keyboard Maestro to know the applet is available and has a menu.

Keyboard Maestro's select menu action is expecting a proper application with a normal user interface.

I'm very surprised the select menu action works at all under any circumstances.

I'll have to experiment and see if it will work with other applets...

-Chris

If it helps with your experiments, I did need to turn on the System Settings > Accessibility > Display > Reduce Transparency option in order for KM to consistently find the menu bar applet's icon.

1 Like