Generally, when files are dropped in your ~/Public/Drop Box you can only read them. You have to save a copy if you edit it. I wanted a script that would enable writing and that moved them to your desktop. So I wrote a Folder Action that let me do both things. If I could not enable them because of limitations, I want a sudo (SuperUser Do) to be used.
Here is my AppleScript to do this:
on adding folder items to thisFolder after receiving theseItems -- create list of files & folders try -- in case you can't due to limitations repeat with thisItem in theseItems -- take a file to repeat with set thisPath to quoted form of POSIX path of thisItem -- puts the shell path in quotes for ease of use set thisCommand to "chmod u+w " & thisPath -- the command do shell script thisCommand -- execute the file end repeat move theseItems to desktop on error repeat with thisItem in theseItems -- same except with sudo set thisPath to quoted form of POSIX path of thisItem set thisCommand to "sudo chmod u+w " & thisPath do shell script thisCommand with administrator privileges -- added the sudo part end repeat move theseItems to desktop end try end adding folder items to
Mac OS X Hints
http://hints.macworld.com/article.php?story=20091229093022967