How to set Folder Permissions on Enclosing Items


Dave
 

Hi,

Is there anyway to set the permissions of a folder and it contents recursively using AppleScript?

Basically I want the equivalent of the Get Info Window, "Apple to Enclosing Items” option.

Thanks in advance.
Dave


CK
 

A bit late, but in case you didn't work it out yourself, this will get file permissions:

set |path| to POSIX file "/Users/CK/Documents/Scripts/"
tell application id "com.apple.finder" to tell the folder ¬
	|path| to tell (a reference to its entire contents) ¬
	to return everyones privileges of every item in it

And this will set them:

tell application id "com.apple.finder" to tell the folder ¬
	|path| to tell (a reference to its entire contents) ¬
	to set everyones privileges to read only

...and it will do this recursively to all subfolder items.

But, in general, try and avoid using Finder for filesystem operations. Use System Events, or the Foundation framework.