OK, so here’s the thing. I’m a lab manager with students who use remote network user accounts on lab machines. Microsoft Word for OS X has known crashing issues when being run from remote network user accounts. The client machines run OS 10.4.8 and the Server is OS X Server 10.4.8. The research I’ve done indicates the best way to solve this MS Word problem is to replace the “Office Registration Cache X” file in the users prefs (the user directory is on the server) with a blank doc of the same name, then lock the file so when MS Word attempts to recreate this problematic file, it is unable to. It works. Now I need a script for students to run if they want to fix the problem with Word. I will store it and the blank replacement file (unlocked) on our “Help_Files” shared network volume that appears on every desktop. It must be unlocked at the start of the script in order for it to be moved and replace the bad Office Registration Cache X file. Heres what I have:
tell application “Finder”
do shell script “rm -f ~/Library/Preferences/Microsoft/‘Office
Registration Cache X’”
do shell script “cp /Volumes/Help_Files/‘Office Registration
Cache X’ ~/Library/Preferences/Microsoft/”
set myHome to (do shell script "whoami") set locked of file "Office Registration Cache X" of folder "Microsoft"
of folder “Preferences” of folder “Library” of folder myHome of folder
“hmdr” of folder “UserData” of folder “Volumes” of folder
“MyServer” of folder “Network” of folder “private”
of startup disk to true
“UserData” is a partition on the server which houses the network user folders.
The first half of this script works fine. The file is replaced. It is the locking of the new file that seems to be a problem. I get an Applescript error message that says “Cant set locked of blah blah blah” My syntax I believe is OK, I tried setting files on local drives to “locked” and it worked OK. Its either something about attempting to do this over a network that doesnt work, or its something in the path that I have wrong. When I drag the file into into the script editor, it reveals the path I entered in the script.
The shell scripts seem to be a much simpler deal, they recognize the “~/” and place the file where needed. In Applescript, the path to the file becomes trickier. Is there a shell script for locking a file? That would solve the whole problem…or can anyone help me figure out why this isnt working?
Many thanks in advance for the help,