create a folder then change permissions on it ??


I’d like to have an Applescript create a folder “xyz” and then

a separate Applescript to change permissions on that folder to be read-only

If anyone can help that would be wonderful…


Some autumn Terminal reading:

$ man mkdir


$ man chmod

Usage example:

$ mkdir "/Users/you/Desktop/new folder"
$ chmod 755 "/Users/you/Desktop/new folder"

755 is read/write/execute (7) by owner, read/execute by everyone else. You can use AppleScript’s do shell script command to execute the shell commands. There are lots of examples of using these commands and do shell script here in the archives.

one thing that is really important to note here is that it is not necessary to ‘chmod’ a directory made with ‘mkdir’. mkdir provides a switch to allow control over permissions when the directory is created. from the man page:

therefore, mikey-sans command from above could be:

/bin/mkdir -m 755 "/Users/you/Desktop/new folder"