A small tool to lock/unlock the Mac OS Dock

I wrote a small Applescript to prohibit the accidental modification of the dock contents by setting the right defaults values. Nothing complicated or sophisticated, but useful and here for my own documentation.

display dialog “Dock Locker” buttons {“Dock sperren”, “Dock entsprerren”, “Abbrechen”} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is “Dock sperren” then
    do shell script “defaults write com.apple.Dock contents-immutable -bool yes; killall Dock”
else if the button_pressed is “Dock entsprerren” then
    do shell script “defaults write com.apple.Dock contents-immutable -bool no; killall Dock”
else
    — action for 3rd button goes here
end if

The tool can be found here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: