Hello and good afternoon,
I wnat to uste the following script to change the User of files and folder that are dropped into a specific folder.
Background of this:
- User1 is my main account, User2 a tryout account
- sometimes User2 needs files from User1
- User2 can open the files from User1, but User2 is not able to change comments or what ever of the exchanged file
- so I created an “exchange-folder” where User1 drops the files for User2 in
- a folder action (script is below) shall change the user from User1 to User2…
- the “exchange-folder” is set up to be used by both users via system preferences “sharing”
but this doesn’t work. The script is not called when adding files to the “exchange-folder” (the folder is located on /exchange-folder).
I hope someone has a clue for me to get this working. THX in advance
on adding folder items to watchfolder after receiving addeditems
repeat with addeditem in addeditems
set iteminfo to info for addeditem
if folder of iteminfo then
tell application "Finder"
set folderitems to entire contents of addeditem
end tell
repeat with folderitem in folderitems
do shell script "/usr/sbin/chown IUAS:staff " & quoted form of POSIX path of folderitem & "\"" password "xxx" with administrator privileges
end repeat
end if
do shell script "/usr/sbin/chown IUAS:staff " & quoted form of POSIX path of addeditem & "\"" password "xxx" with administrator privileges
end repeat
end adding folder items to
Greeting from Madrid