Turn Volume Down on One App & Up on Another

Looking to hit hotkey and do the following:

  1. Turn volume to 0 on Safair
  2. Turn volume to 100 on Chrome

And when hotkey is hit again it does the opposite:

  1. Turn volume to 100 on Safair
  2. Turn volume to 0 on Chrome

I'd prefer the above to happen on the same hotkey and not make it into two separate hotkeys, but if that's the only way to do it, then I will learn to live with it. Thinking maybe an if/then script can be used, but I don't know how to write it (e.g. if safari volume is 0, set to 100, if safari volume is 100, set to 0 -- something like that).

I don't want to have it mess with the system volume. I still want to be able to adjust mute and volume from my keyboard as usual, I just would like to change the individual volume on the apps when KM macro is activated.

REASON (IF YOU CARE):

I have a monitor on a TV to watch the news all day. I get voice texts throughout the day that I need to listen to. I currently have to mouse over to the TV monitor (in full screen mode, so no immediate displayed volume controls, and monitor is "far" away from my other apps, so mousing over 50 times a day starts to get annoying), click mute, and then go back to my other app and listen to the messages. Then reverse the process.

Thoughts--I can watch the TV news in Safari and listen to my messages in Chrome. When I want to listen to my messages I use KM to run the script so volume cuts out of Safari/news and I listen to my voice text, and when done, i hit the KM shortcut again and my news volume comes back on.

You need this and your macro to control BackgroundMusic:

1 Like

Just spitballing here, and trying to think of the simplest way to achieve this without using shell scripts or AppleScript)... could you use the Select Menu Item action to mute a site in Chrome/Safari respectively?

This might be challenging is the frontmost window in those applications is not the window that's currently producing sound (for instance you have several Safari windows/tabs open and the news window/tab is not the frontmost), but it's an idea.

Edit: I moved your topic to the Questions and Suggestions category. Keep us posted if you still need help!