Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Logic Pro scripty bits: tracking current Input device

Got a call recently for a post house that wants to have a dashboard of what input devices are running in Logic Pro across a fleet of audio edit bays. Logic still uses a standard .plist format to store settings in ~/Library/Preferences/ So it’s easy enough to read and write settings. There’s a lot in there but let’s focus on just the Current Hardware, which is in a dictionary called AudioHardwarePreferences. We can find that by running the defaults command on the defaults domain followed by the dictionary name:

defaults read AudioHardwarePreferences

The output then shows us the last few and some other information (e.g. we can actually use that DeviceID to control things using the core audio frameworks):

{ CurrentCoreAudioDeviceID = 97; CurrentCoreAudioDeviceName = "External Headphones"; CurrentCoreAudioDeviceUID = BuiltInHeadphoneOutputDevice; CurrentCoreAudioInputDeviceID = 108; CurrentCoreAudioInputDeviceName = "RODE NT-USB"; CurrentCoreAudioInputDeviceUID = "AppleUSBAudioEngine:RODE Microphones:RODE NT-USB:14210000:2"; CurrentCoreAudioInputModelUID = "RODE NT-USB:19F7:0003"; CurrentCoreAudioModelUID = "Codec Output"; LastUsedCoreAudioDeviceNames = ( "External Headphones", "RODE NT-USB", "Scarlett Solo USB", PA248, "MacBook Pro Speakers" ); LastUsedCoreAudioInputDeviceNames = ( "RODE NT-USB", "External Microphone", "Scarlett Solo USB", "MacBook Pro Microphone" ); }

To then parse out just the current audio device we need to see what the CurrentCoreAudioInputDeviceName key in the AudioHardwarePreferences dictionary is, so we can turn to PlistBuddy for that operation:

/usr/libexec/PlistBuddy -c "print 'AudioHardwarePreferences':CurrentCoreAudioInputDeviceName" ~/Library/Preferences/

The output in my case would then just be:


The post Logic Pro scripty bits: Tracking Current Input device appeared first on krypted.

This post first appeared on | Tiny Deathstars Of Foulness, please read the originial post: here

Share the post

Logic Pro scripty bits: tracking current Input device


Subscribe to | Tiny Deathstars Of Foulness

Get updates delivered right to your inbox!

Thank you for your subscription