Followup: Change folder/file ownership
Followup: Change folder/file ownership
- Subject: Followup: Change folder/file ownership
- From: Henrik Boes <email@hidden>
- Date: Wed, 18 Dec 2002 10:17:59 -0700
Thanks for your responses.
Three things:
1) Some of you mentioned that adding the admin to the network user
group would solve my problems without scripting. Point taken.
2) With the help of Laine Lee's excellent uptowner applescript and
Apple's Folder Actions scripts from OS X 10.2, I was able to assemble a
very basic script that does the job (with an important caveat, see
below). I'm sure it lacks elegance and flexibility, but it works and I
post it as an FYI for newbies such as yours truly. Here 'tis:
property adminPass : "[password]"
on adding folder items to this_folder after receiving added_items
do shell script "sudo /usr/sbin/chown -R [username] [path]" & ";"
password adminPass with administrator privileges
end adding folder items to
Save this as a script (e.g., chown.scpt) in the Folder Action Scripts
folder (Library/Scripts/Folder Action Scripts) , enable Folder Actions
via the Script Menu (which you'll find in the AppleScript folder in the
Applications folder -- double-click to add it to the menu area), run
the Apple-provided "Attach Script to Folder" AppleScript, which will
ask you which script you want to attach and what folder to attach the
script to. That's it.
3) This script works fine if there are no spaces in the UNIX path
specified in the shell script. If there *is* a space, such as in
/Volumes/Files\ HD/Test, the syntax checker in Script Editor kicks back
an error, saying the space after the "\" is an unknown character. Does
anyone know how to address this issue?
Thanks again for all the great feedback.
Henrik Boes
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.