The Dock isn't scriptable (yet), but you could work around it by writing the hiding state to its preferences file & restarting the dock. This should work, but it requires Mac OS X 10.1.2 for the "do shell script" command:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>set dockhide_state to (do shell script <font color = red>"defaults read com.apple.dock autohide"</font>) as text
if dockhide_state = <font color = red>"<font color = blue>1</font>"</font> then
set theBool to <font color = red>"no"</font>
else
set theBool to <font color = red>"yes"</font>
end if
do shell script (<font color = red>"defaults write com.apple.dock autohide -bool "</font> & theBool as text)
try
tell application <font color = red>"Dock"</font> to quit
end try</font>[/code]
If you don't have OS X 10.1.2 installed, the statement:
tell app "Terminal" to do script with command
could be used in place of "do shell script", but it launches the terminal to run the commands.
