Use 'mkdir' shell script to create a folder

This script replaces complicated recursive routines which create a folder at a given path. Basic applescript methods of creating a folder, such as a Finder "make new folder..." command, require that all folders within the target path already exist. Using the UNIX 'mkdir' command with the -p flag creates the target folder by simply declaring the target folder path. All parent directories are automatically created, if necessary.

 

Usage...

Declare the posix path to the new folder in the 'tmpPath' variable. Run the script to create the new folder.

Code...

set tmpPath to "/Users/you/Desktop/Test/Folder"
set tmpScript to "mkdir  -p '" & tmpPath & "'"
do shell script tmpScript

 

 

Hosted by www.Geocities.ws

1