2 Replies Latest reply: Jan 20, 2007 10:36 PM by Gary Kerbaugh
Dmcrory Level 1 Level 1 (15 points)
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)  
  • foilpan Level 4 Level 4 (1,385 points)
    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)  
  • Gary Kerbaugh Level 6 Level 6 (18,040 points)
    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.