Scripting the Dock

I am completely new to Applescript so apologies if this sounds really naive. I want to be be able to write a script that simply makes the dock as small as possible. Can you do this with applescript?

Thanks for any help.

James

Hello James,

If you look on the Mac OS/X hints.com site (http://www.macosxhints.com/), I think you’ll find a script to kill the dock altogether. How about that?
Or, try this (from the same site, in the Panther section) :

         "Making the dock as unobtrusive as possible
          Mon, Apr 26 '04 at 09:33AM • from: Wolf on Air           

        I don't use the dock much at all, so here's what I do to keep it out of the way. Open the Terminal and enter these commands (the part after the $): 

$ defaults write com.apple.dock launchanim -bool no
$ defaults write com.apple.dock magnification -bool no
$ defaults write com.apple.dock autohide -bool yes
$ defaults write com.apple.dock orientation -string top
$ defaults write com.apple.dock pinning -string end
$ defaults write com.apple.dock tilesize -int 16

This hides the dock in the top right corner under the menu bar, with the nice side effect of freeing up the few pixels it eats even when hidden in the other three screen edges. The few times I need it, I usually just toggle the autohide setting via the keyboard (Command-Option-D by default; configure a better one in system preferences), though it’s possible to hover the cursor just under the menu bar too.

Oh, and these tweaks (specifically, the launchanim setting) also turns off the annoying bouncing icons when launching an application. Have fun!"

Sincerely,

Variable as the shade

Thanks to Variable as the shade’s post, this AppleScript script should minimize the Dock to what appears to be its lowest setting. I tried to do this earlier but I couldn’t figure out the integer part (the number value was being entered in the plist as a string).

set command to "defaults write com.apple.dock tilesize -int 16"
do shell script command
tell application "Dock" to quit

Note: The Dock will quit and restart.

– Rob