Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Remove items from the Dock with UNIX Script

Is there a safe way to remove Office X Word, Excel, PowerPoint from the Dock using both Mac OS X 10.3.x and 10.4.x?

G4 1.42 Mac OS X (10.3.5)

G4 1.42 Mac OS X (10.3.5)

Posted on Jan 20, 2007 9:24 AM

Reply
2 replies

Jan 20, 2007 10:01 AM in response to Dmcrory

are you looking to prevent someone from adding these items to the dock? you can prevent the dock from being changed altogether, if that's the case.

otherwise, you'll have to edit the users' ~/Library/Preferences/com.apple.dock.plist files.

to get an idea of what's there, open it in property list editor (part of the developer tools) or use: <pre>defaults read ~/Library/Preferences/com.apple.dock</pre>

macbook pro 2.16 ghz, powerbook G4 1ghz, G4 400 mhz, poweredge and some junkers Mac OS X (10.4.8)

Jan 20, 2007 10:36 PM in response to Dmcrory

Hi Dmcrory,
The following command should remove a persistent app from the doc whose path matches "zzzz". If you replace the "zzzz" with "Microsoft", or maybe "Office 2004", it may remove all of the apps you want to remove.

defaults write com.apple.dock persistent-apps "$( defaults read com.apple.dock persistent-apps | awk 'BEGIN{ ARRAY = "("; ELEM = "" } / {/{ while ( $0 !~ /^ }/ ) { if ( ELEM == "" ){ ELEM = $0 } else { ELEM = ELEM "\n" $0 } if ( $0 ~ "_CFURLString\"" && $0 !~ /zzzz/ ){ FOUND = "true" } getline } ELEM = ELEM "\n" $0; if ( FOUND == "true" ){ ARRAY = ARRAY "\n" ELEM }; FOUND = "false"; ELEM = "" } END{ sub( /,[^\n]*$/, "", ARRAY); print ARRAY; print }' )"

There are two places in the above command where there are four consecutive spaces. I had to put non-breaking spaces above so you'll have to put back real spaces to get the command to work.
--
Gary
~~~~
audiophile, n:
Someone who listens to the equipment instead of the music.

Remove items from the Dock with UNIX Script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.