(* ADD - ENABLE SHARED WRITE ©2006 JD Smith This Folder Action handler is triggered whenever items are added to the attached folder. The script will change the group ownership of the added items to the parent directory's group, and ensure the group can write to the files. This permits the members of the parent directory's group to have write acccess to the files. *) property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer. on adding folder items to this_folder after receiving these_items try set the item_count to the number of items in these_items set alert_message to ("Folder Actions Alert:" & return & return & Â "Enabled Shared Write Access for:" & return) as Unicode text tell application "Finder" set folder_path to the quoted form of the POSIX path of this_folder do shell script ("ls -ld " & folder_path) set this_group to word 4 of the result repeat with this_item in these_items set this_path to the quoted form of the POSIX path of this_item set this_script to ("chgrp -R " & this_group & " " & this_path & Â "; chmod -R g+w " & this_path) do shell script this_script if item_count is equal to 1 then set alert_message to alert_message & Çdata utxt201CÈ & Â (name of this_item as Unicode text) & Çdata utxt201DÈ end if end repeat if the item_count is greater than 1 then set alert_message to alert_message & (the item_count as text) & Â " items" end if display dialog the alert_message buttons {"OK"} with icon 1 Â giving up after dialog_timeout end tell end try end adding folder items to