Lock the Dock

Hi =) I am wanting to find a way to lock the Dock. I have 60 iMacs and I can not keep the Dock the same size, in the same spot and with the same icons on it on all 60 of them all the time. I am using OS X 10.2.8. I know I can add multiple users and keep icons from disappearing, but it won’t keep the Dock the same size.

I would like to make something that either keeps the Dock from being changed in any way or if that isn’t possible, something that will reset the Dock to the way I want it when I turn the computers on.

I am not very good with AppleScript. I come here when I want to do someting that I can’t figure out.

Could someone please help me get started? I have no clue where to begin.

Thanks,
Connie

Topic moved to AppleScript | OS X - the dock is only in OS X (10.2.8) in this case.

In Tiger at least, the Dock attributes are stored in ~/Library/Preferrences/com.apple.dock.plist. Perhaps you could copy the .plist for the one you want and restore it to your standard copy when it was changed.

If you mean to go to the hard drive, then to Library, then to Preferences,
mine is like this com.apple.dockfixup.plist

Is there somewhere else I can look? Or am I looking in the right place?

I tried right clicking on com.apple.dockfixup.plist and clicking on File then Get Info and changing the Ownership and Permissions to no access. It didn’t work. I can still “poof” the items off the Dock.

No, I meant HD/users/aUser/Library/Preferences/com.apple.dock.plist

Okay, I found that =) I can make a script that runs at start up that will replace that file with the one I want. Thanks so much for helping me!!!

Remember that you can find the path to that folder in generic terms so you don’t have to know who the user is (with appropriate privilege, of course)

(path to preferences folder from user domain as text) & "com.apple.dock.plist"

Thanks =) I am going to take one of the Macs home this weekend and work on it. I am sure I will come back asking for more help. Thanks for being so quick to reply and help me (as always).

Connie

Okay, I didn’t even make it home before I needed help. This is the script I found and modded, but it doesn’t work.


set myFile to "Mac HD:Applications:Utilities:Dock:com.apple.dock.plist"
set myFolder to "Mac HD:Users:middel:Library:Preferences"
tell application "Finder"
	duplicate myFile to myFolder with replacing
end tell

Then I get this result -

document file “com.apple.dock.plist” of folder “Preferneces” of folder “Library” of folder “middel” of folder “Users” of startup disk of application “Finder”

So, I must have done something wrong.

Hi Connie - those kids still giving you grief? :wink:

The result you got was simply Finder returning a reference to the duplicated file. (Such info can sometimes be helpful if a script subsequently needs to do something else with the file.)

The main reason the script doesn’t appear to work is that the Dock is still using its most recent settings. To get it to load the restored ones, try getting it to quit and then relaunch. In the following example, I’ve also replaced the hard-coded file/folder paths with alternatives that should work on any machine (as long as a file “com.apple.dock.plist” exists in a folder “Dock”, within the /Applications/Utilities/ folder).

set myFile to (path to utilities folder as Unicode text) & "Dock:com.apple.dock.plist"
set myFolder to path to preferences folder
tell application "Finder" to duplicate file myFile to folder myFolder with replacing
quit application "Dock"
launch application "Dock"

(Incidentally, if you change Dock settings to test this, it may work a bit better if you allow a few seconds between the last change and running the script.)
:slight_smile:

Thanks for helping me!!! I got it working. I hid it and put it in my start up items. It works like a charm.

I think that the kids will always give me grief LOL, but it gives me fun things to work on like the scripts you have helped me with.

I like for all the computers to look uniform. I changed the file preferences for System Preferences to No Access so they can’t change anything in there. I got the No Mouse alert to work (except for the unmuting it part). I found a program that locks folders and they can’t delete things out of the folders or move them. And lastly I got the replacing Dock idea to go. All of this I couldn’t have done without all the wonderful help I get from you all =)

Thanks so much!

Given 60 machines, all being accessed at different times by different folk (including a bunch of little tinkers) - that’s an aim worth striving for, Connie.

Great news! :smiley:

See you next time there’s a need for mature experience to temper youthful ingenuity… :wink:

Looks like I’m a little late for this thread, but I simply found the preference file, chose “Get Info” and locked the file. Not matter what changes are made to the dock while the machine is running, it always reverts to the original after a reboot.

Must depend on the version of OS X you are running. I tried that and it didn’t work.

Could be… my kiosk machines are running 10.3.2.

You know, I didn’t try it with that plist file. I only tried it with the other one that I tried first. It does work with 10.2.8.

It was still a fun experience learning something new and getting the script to work.

I am glad you posted about it. There are other techs that have labs just like mine and they have no clue about AppleScript. This is an easier way to share this with them.

Thanks =)