Jump to content
Sign in to follow this  
MacCast

Setting up Shared Permissions - Show #435 2013.03.13

Recommended Posts

MacCast    80

Listener Alan had a great idea to use a little AppleScript and Folder Actions to solve the issue of creating a folder that could share documents and files between two user accounts on the same Mac.

 

In MacCast dated 2013.03.13, listener Dan asked for an easier way to save files to the users 'Public' folder so that they could be edited by other users. I thought that this is a problem that could be solved by using a folder action through Applescript. Below is an Applescript which changes permissions to (-rw-r--rw-) of any file placed into the folder in what I think is an elegant albeit very geeky way. Although not as nerdy as ACL's. ;-)
on adding folder items to targetFolder after receiving addedItems
set myList to every item of addedItems
repeat with i from 1 to the count of myList
tell application "System Events"
set posixPath to the POSIX path of item i of myList
do shell script ("chmod 664 " & "'" & posixPath & "'")
end tell
end repeat
end adding folder items to
Save this script as an application in the user's Library folder under "Scripts/Folder Action Scripts"
or if you want every user to be able to have the same functionality, save the application to the system library
"/Library/Scripts/Folder Action Scripts". Create the folder if it isn't present.
Next step is to right/control click on the folder that has shared access, select "Folder Actions Setup" and select the folder action you just saved and thats it
This script works for 1 or more files transferred into the shared folder, and works irrespective of how you put files into it (saving, dragging, copy/paste).
  • Like 19

Share this post


Link to post
Share on other sites
haivu    21

I like the solutions Adam and others suggested so far. However, I am trying to think outside the box (literally and figuratively) and came up with a couple of solutions. They might or might not be what the original listener want.

 

The first solution proposes using external storage and format it to FAT32. The external storage could be a USB key (AKA thumb drive), an old SD card that you no longer use, or an external hard drive. This solution has a couple of advantages:

  • No permission to deal with, since FAT32 does not support it
  • Simple to implement and use
  • In the case of SD card: since the card is almost flushed into the Mac, you even forget that it is there

The disadvantages include:

  • Depend what you already had, you might have to spend some money
  • One port (USB, firewire,...) is tied up
  • In the case of SD card: the SD slot is tied up. If you need that slot often, this solution might not work well for you.

Solution #2: use Dropbox. Who said Dropbox sharing has to work across different machines? Other services such as box.com, skydirve, Google Drive, might work also.

 

Solution #3: If you have a Time Capsult (Apple's router and hard drive combo), create a common user account and connect to it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×