kyleneideck / BackgroundMusic

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
GNU General Public License v2.0
16.06k stars 674 forks source link

Feature Request: Applescript control for sliders #278

Open ihorner opened 4 years ago

ihorner commented 4 years ago

I'd like to be able to set sound source volumes via AppleScript or similar — I can't seem to find any information regarding this, and the dictionary seems to only apply to setting output.

I'm using BetterTouchTool to send volume levels from a midi device with faders, and I'd like to associate the faders with different sources in BackgroundMusic.

kyleneideck commented 4 years ago

Good idea. As far as I can tell, the AppleScript API only supports reading and changing the output device so far.

broady commented 4 years ago

@kyleneideck how can you do that? that'd be pretty useful on its own.

sorry, I'm a bit of an AppleScript noob. is there some way to explore the API of an app?

edit: found via "Open Dictionary" in AppleScript Editor...

image

tell application "Background Music"
    set selected output device to (output device "External Headphones")
end tell

but yes, +1 to this, and being able to set volume of the output would be great too. macOS built-in set volume output volume 40 is really slow.