Hey fellow admins! How do you add specific apps to the Dock on your Mac endpoints? Does anyone here use some sort of scripting solution that you’d be willing to share? Thanks.
Add specific apps to the Dock on MacSolved
Replies (2)
Here’s what we put together to run in our environment:
—————————————————————————————————–
#!/bin/bash
LOGGED_USER=stat -f%Su /dev/console
sudo su $LOGGED_USER -c ‘defaults delete com.apple.dock persistent-apps’
dock_item() {
printf ‘<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>%s</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>’, “$1”
}
# Declare all apps here
notes=$(dock_item /System/Applications/Notes.app)
chrome=$(dock_item /Applications/Google\ Chrome.app)
mail=$(dock_item /Applications/Mail.app)
sudo su $LOGGED_USER -c “defaults write com.apple.dock persistent-apps -array ‘$notes’ ‘$chrome’ ‘$mail'”
killall Dock
—————————————————————————————————–
The script will detect the currently logged-in user and then customize the dock for that user account.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Aagosh.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Aagosh.
- This reply was modified 2 years, 6 months ago by Aagosh.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
- This reply was modified 2 years, 6 months ago by Chris.
@aika This is great! Appreciate it.
-
Expand