-1

I want to pin an item (an app or a .webloc file) in the MacOS dock. I have seen in other forums and threads that it could be done using the following command.

defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" & **file/location** & "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'

This command adds the item in the com.apple.dock.plist file, which stores all the items present in the dock. This file is present in ~/Library/Preferences/.

But after running the command, the dock needs to be killed once for the item to show in it. Killing the dock can have undesirable effects, for example it maximises the minimised apps and files. Is there any way to pin the item without killing the dock?

I have tried to see if apple has provided an API for this, but couldn't find one.

0 Answers0