is there a way to know by code the app set in System Preferences > “CDs & DVDs” > “When you insert a music CD:”?
That is: the app selected in the menu next to “When you insert a music CD:”?
Suggestions welcome. Thank you.
Should be in a users specific preferences file (plist)
Just not sure which one but you can locate things that have changed with something like this
I would not consider this to be a supported interface, but the settings for managing this are mentioned in Mac OS X Security Configuration for Mac OS X Version 10.6 Snow Leopard document. Search for “Securing CDs & DVDs Preferences”.
Thank you both, Norman and Joe. I’ll look into it.
Ah - Joe had just answered this and I was going to point to the same doc. Amazing that we have to go back to 10.6 documentation to find pertinent answers like this. Here’s the important part of that document:
# Securing CDs & DVDs Preferences # ----------------------------- # Default Setting: # Preference file non existent: /Library/Preferences/com.apple.digihub # Blank CD: Ask what to do # Blank DVD: Ask what to do # Music CD: Open iTunes # Picture CD: Open iPhoto # Video DVD: Open DVD Player # Suggested Setting: # Disable blank CD automatic action. sudo defaults write /Library/Preferences/com.apple.digihub com.apple.digihub.blank.cd.appeared -dict action 1 # Disable music CD automatic action. sudo defaults write /Library/Preferences/com.apple.digihub com.apple.digihub.cd.music.appeared -dict action 1 # Disable picture CD automatic action. sudo defaults write /Library/Preferences/com.apple.digihub com.apple.digihub.cd.picture.appeared -dict action 1 # Disable blank DVD automatic action. sudo defaults write /Library/Preferences/com.apple.digihub com.apple.digihub.blank.dvd.appeared -dict action 1 # Disable video DVD automatic action. sudo defaults write /Library/Preferences/com.apple.digihub com.apple.digihub.dvd.video.appeared -dict action 1 # Available Settings: # action 1 = "Ignore" # action 2 = "Ask what to do" # action 5 = "Open other application" # action 6 = "Run script" # action 100 = "Open Finder" # action 101 = "Open itunes" # action 102 = "Open Disk Utility" # action 105 = "Open DVD Player" # action 106 = "Open iDVD" # action 107 = "Open iPhoto" # action 109 = "Open Front Row"
Actions 106, 107, and 109 are probably ignored in 10.10 and 10.11. Though, 107 might open Photos on the newer OS X.
Note also that there are setting the system-wide values. For per-user versions, remove the “sudo” and be logged in as a specific user.
Thank you, Tim, for digging up the doc.
But what a pity, sandboxing the app, specialfolder.Preferences or SpecialFolder.UserLibrary.child(“Preferences”) are not accessible.
And it seems there is no specific entitlement to rely on.