Search code examples
xcodemacosdock

com.apple.dock.plist is changed in macOS14.0 and later


Currently, we are working on the enterprise project that using data in ~/Library/Preferences/com.apple.dock.plist to get detail design of the original Dock (as autohide, orientation). It still has been worked until macOS 13.* as description as below: enter image description here

But, It has been changed in macOS 14.* enter image description here

Is there any alternative method to do that in macOS 14.* and later?

Code I used to get:

 if let defaults = UserDefaults(suiteName: "com.apple.dock"),
           let orientation = defaults.string(forKey: "orientation") {
    }
}


Solution

  • I get this Apple Script can help me. My bad that I dont seek for the Apple Scripts for more.

    tell application "System Events" to set dockProperties to screen edge of dock preferences