I need a script that changes the the permissions of any file that is dropped into a specific folder. I have a script here that will changed the permissions of a folder but not a file. Can anyone help me with this?
Thanks
Wallaper
on adding folder items to this_folder after receiving these_items
tell application “Finder”
set j to the number of items in these_items
set i to 1
repeat until i > j
--display dialog "number of items " & j & " i = " & i
set everyones privileges of (item i of these_items) to read write
--display dialog "after everyone's"
set group privileges of (item i of these_items) to read write
--display dialog "after group's"
set owner privileges of (item i of these_items) to read write
--display dialog "after owner's"
--display dialog " i = " & i
set i to i + 1
end repeat
end tell
in the shell the startup disk on every Mac is just / (a slash),
so this works regardless of the name of the startup disk and without involving the terminal
I use this saved as a application run only, I just drop the folder I want onto it.
on open (these_objects)
repeat with each_object in these_objects
tell application "Finder"
activate
set owner privileges of each_object to read write
set group privileges of each_object to read write
set everyones privileges of each_object to read write
repeat with file_object in (entire contents of each_object)repeat
set owner privileges of file_object to read write
set group privileges of file_object to read write
set everyones privileges of file_object to read write
end repeat
end tell
end repeat
end open
Sorry for the confusion, I am working on network printer configs at the same time and getting a few wires crossed. It makes sense now. You were right, and I was using the wrong shell script.
I am going to be running a script that includes this on more Macs and am curious if I can enter the name and password of an admin, so I do not have to go to the Mac in person. I am a bit nervous about putting the log in of an admin into a script, but I would have to do this in person otherwise.