Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 01-29-2007, 08:14 PM   #1
sorahn
Prospect
 
Join Date: Sep 2006
Posts: 27
Dock Lock

Heya, i'm looking for an app that will lock the status of the dock from drag and drop. I find that on my laptop i'm always accidentally dragging an app out of the dock and dropping it somewhere on the screen making it poof.

If anyone can point me in the right direction, that would be awesome.

Thanks!
sorahn is offline   Reply With Quote
Old 01-30-2007, 02:32 PM   #2
melon
All Star
 
Join Date: Mar 2005
Posts: 549
TransparentDock can do it (amongst other options), however the program isn't free.
melon is offline   Reply With Quote
Old 01-30-2007, 10:35 PM   #3
acme.mail.order
Hall of Famer
 
Join Date: Sep 2003
Location: Tokyo
Posts: 4,419
Tried the low-tech solution of just locking the com.apple.dock.plist file?
acme.mail.order is offline   Reply With Quote
Old 01-31-2007, 12:03 PM   #4
melon
All Star
 
Join Date: Mar 2005
Posts: 549
Quote:
Originally Posted by acme.mail.order
Tried the low-tech solution of just locking the com.apple.dock.plist file?

I've not personally tried, but it seems that won't work according to this post: http://forums.macosxhints.com/showthread.php?t=5474

In a non-admin account you can lock the Dock in System Preferences > Accounts > Parental controls, though this may be quite bothersome. OS X Server can do this for all accounts apparently but then you need to own it.

Edit:- This may work:

Quote:
The "Dock" can be locked to prevent the accidental removal of items as you described. Try opening "/Applications" > "Utilities" > "Terminal.app" and entering these two commands:

defaults write com.apple.dock contents-immutable -bool true
osascript -e 'tell application "Dock" to quit'


To unlock it again, just repeat the commands, using "false" instead of true.

I don't have "Tiger" so I don't know where things stand now, but in early versions of "Tiger", there was a bug so that it was possible to intentionally bypass this setting using the "Remove from Dock" contextual menu item - so this method would no longer work (as it does in "Panther") to prevent tampering with the "Dock" . But for preventing accidental drags, it should be fine.

You could probably create an AppleScript/Automator Action to toggle the option on/off (something similar to this), but I don't know how.

Last edited by melon; 01-31-2007 at 12:25 PM.
melon is offline   Reply With Quote
Old 01-31-2007, 12:57 PM   #5
melon
All Star
 
Join Date: Mar 2005
Posts: 549
I've had a quick go at AppleScripting, this seems to work:

Code:
display dialog "Lock the Dock..." buttons {"Lock", "Unlock", "Cancel"} default button 3
copy the result as list to {buttonpressed}
if the buttonpressed is "Lock" then
	try
		tell application "Dock" to quit
		do shell script "defaults write com.apple.dock contents-immutable -bool true"
		delay 1
		tell application "Dock" to activate
	end try
else if the buttonpressed is "Unlock" then
	try
		tell application "Dock" to quit
		do shell script "defaults write com.apple.dock contents-immutable -bool false"
		delay 1
		tell application "Dock" to activate
	end try
end if
Put that into Script Editor and save it as an application.

The code was based on this hint and there are loads of variations. It can probably be made better considering I know very little AppleScript

Last edited by melon; 01-31-2007 at 01:00 PM.
melon is offline   Reply With Quote
Old 12-17-2009, 11:39 AM   #6
jschact6
Registered User
 
Join Date: Dec 2009
Posts: 1
Locking the Dock

I have found an easy program that will lock the dock for you. It is called Deeper and if you go into the "Dock" tab you can check "Lock the icons".
In order to get Deeper you can visit:
jschact6 is offline   Reply With Quote
Old 01-31-2007, 04:26 AM   #7
sorahn
Prospect
 
Join Date: Sep 2006
Posts: 27
hmm, never thought of that.

So, doing it that way i'm still able to edit it, but if i kill / relaunch it, it returns to what it was.

Cool! thanks!
sorahn is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Site design © Mac Publishing LLC; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of Mac Publishing LLC.