Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enable write flag on Drop Box files via Folder Actions Desktop
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
[robg adds: To use this, save the script in your user's Library » Scripts » Folder Action Scripts folder, and then attach it to your Drop Box folder as a Folder Action. In 10.5, Control-click on the Drop Box folder and select More » Attach a Folder Action from the contextual menu; in 10.6, choose Folder Actions Setup from the contextual menu. I haven't tested this one. Also note this hint, which explains Drop Box folder permissions in a clear and easy-to-understand manner.]
    •    
  • Currently 1.69 / 5
  You rated: 2 / 5 (16 votes cast)
 
[6,156 views]  

Enable write flag on Drop Box files via Folder Actions | 5 comments | Create New Account
Click here to return to the 'Enable write flag on Drop Box files via Folder Actions ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Enable write flag on Drop Box files via Folder Actions
Authored by: V.K. on Jan 05, '10 08:22:57AM
This hint is only relevant for Tiger and earlier. In 10.5 and 10.6 your Drop Box has an inherited ACL that gives you read+write access to everything dropped into the Drop Box. So there is absolutely no need for any folder actions there. If your Drop Box has no ACLs for some reason you can boot from the install disk and reset the ACLs on your home directory using the password reset utility. Or you can do it from terminal by running

chmod +a "$USER allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,\
writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit" ~/Public/Drop\ Box


[ Reply to This | # ]
Enable write flag on Drop Box files via Folder Actions
Authored by: slb on Jan 05, '10 01:28:37PM

More simply:

sudo chmod -RN ~



[ Reply to This | # ]
Enable write flag on Drop Box files via Folder Actions
Authored by: renaultssoftware on Jan 05, '10 03:20:14PM

Well, the move-to-desktop part is new.



[ Reply to This | # ]
Enable write flag on Drop Box files via Folder Actions
Authored by: Anonymous on Jan 05, '10 09:11:25AM

Oh...."Drop Box"...I was excited that this might be a hint for "Dropbox".



[ Reply to This | # ]
Enable write flag on Drop Box files via Folder Actions
Authored by: slb on Jan 05, '10 02:34:20PM

If it were, it would have said "Dropbox" ;)



[ Reply to This | # ]