Changing Privileges and moving files

Hi
Can someone please tell me why this doesn’t work?
Thanks!!

on open (this_file)
tell application “Finder” to set the owner privileges of this_file to read write
tell application “Finder” to set group privileges of alias this_file to read write
tell application “Finder” to set the everyones privileges of alias this_file to read write
tell application “Finder” to move this_file to the folder “foldername” of the folder “Desktop” of the folder “foldername” of the folder “Users” of the startup disk
end open

Because your open handler is probably getting a list of files. This will probably work for what you want (it is untested but will get you further along). Save this as an application then drag and drop the files (whose permissions you want to change and move) on to the icon of the saved application:

Jon

[quote=“jonn8”]

This seems to work perfectly!! Thanks for your help!!

How can i make this work on a bunch of files and folders at once, but i do not want to move the files. I just want to change the permssion. I want to drag a group of files over the script and have it change the permissions. I have removed the move this_file to folder (((path to desktop) as string) & “foldername”) line and i can get it to work on a group of just files. but if there are files inside of folders it dose not seem to change them.

Any suggestions??

To do that, you can use chmod (with do shell script). Use -R to go through folders.

on open (theseFiles)
	repeat with thisFile in theseFiles
		do shell script "chmod -R 777 " & quoted form of POSIX path of thisFile -- makes it readable/writable/executable
	end repeat
end open

Edit: Added quoted form of, thanks Jacques.

That workes except where there is a space in the folder or file name. Any suggestions?

no luck. now the script dose nothing. This is what i have.

on open (theseFiles)
repeat with thisFile in theseFiles
do shell script "chmod -R 777 " & quoted form of (POSIX path of thisFile)
end repeat
end open

The input theseFiles needs to come from somewhere. on open() only works if you save the script as an droplet.
Try this:

set theseFolders to choose folder with multiple selections allowed
repeat with thisFolder in theseFolders
    do shell script "chmod -R 777 " & quoted form of POSIX path of thisFolder -- makes it readable/writable/executable
end repeat

P.S. Please enclose your script in these: [code]


[/code]

It is working with this script now.

on open (theseFiles)
   repeat with thisFile in theseFiles
       do shell script "chmod -R 777 " & quoted form of POSIX path of thisFile -- makes it readable/writable/executable
   end repeat
end open

But you can only drop one folder full of files or on file. Try to drop two files or two folders and it errors out.