Automating Folder, subfolder, sub subfolder creation



property subf_names : {"Documents", "Graphics", "Photography", "Video"}
--
display dialog "Enter job name:" default answer "job name"
set j_name to text returned of result
set temp_name to j_name
tell application "Finder"
	set main_folder to (make new folder at disk "imagesafe" with properties {name:temp_name}) as alias
	repeat with this_name in subf_names
		set temp_name to this_name
		make new folder at main_folder with properties {name:temp_name}
		
	end repeat		
end tell


I am trying to create a script that asks for a folder name, then creates a folder with that name, and populates the folder with a predefined list of subfolders and then populate those subfolders with predefined sub-subfolders.

My script works great for the folder and subfolder creation, but I am stuck at creating the sub-subfolders.

I’m new to applescript and would appreciate any suggestions.

Thanks!

Model: Intel G5 Mac Pro
AppleScript: 2.3 (118)
Browser: Firefox 3.6.14
Operating System: Mac OS X (10.6)

Hi,

I always like this solution to create folder hierarchies


set jobName to text returned of (display dialog "Enter job name:" default answer "job name")
set baseFolder to "/Volumes/imagesafe/"
do shell script "/bin/mkdir -p " & quoted form of baseFolder & "/" & ¬
	quoted form of jobName & "/{Documents/{Documents1,Documents2},Graphics/{Graphics1,Graphics2},Photography/{Photography1,Photography2},Video/{Video1,Video2}}"

Thanks!

This works great! I knew there had to be a better way! It also gives me other ideas of how to script for future projects.

Thanks for your insight!