Just wondering how you could add more levels of subfolders.
I am trying to figure out the logic involved and get stuck. When the “MediaSubFolder” items get made, I’m not able to figure out how to redirect the makesubfolder function to those items so I can make folders in those items. The closest I can figure is to add logic in the function, but that seems clumsy. I’d love to make the function run “clean”.
Here’s my version…the comments in the middle were logic/commments I was playing with.
property MasterFolderName : "Default"
property subFolderName : "Default"
set the SubFolderList to {"Projects", "Media", "Post_Audio_PT", "Finishing"}
set the MediaSubFolderList to {"Audio", "GFX", "Rename_Disk_001"}
set the AudioSubFolderList to {"Tracks", "Music", "SFX"}
set the FinishingSubFolderList to {"Act_1", "Act_2", "Act_3", "Act_4", "Act_5", "Act_6", "Act_7", "Act_8"}
set the PostAudioPTSubFolderList to {"Act_1", "Act_2", "Act_3", "Act_4", "Act_5", "Act_6", "Act_7", "Act_8"}
set the TracksSubFolderList to {"Scratch", "VO_Tracks"}
set the GFXSubFolderList to {"Animation", "Stills", "AE_Projects"}
set the MasterFolderName to text returned of ¬
(display dialog "Project name" default answer "")
set the MasterFolderHome to choose folder with prompt "Choose place to put project folder"
--Make Master Folder
set the MasterFolder to makefolder(MasterFolderHome, MasterFolderName) as alias
--Make Main SubFolders
repeat with subFolder in SubFolderList
set mainSF to makefolder(MasterFolder, (MasterFolderName & "_" & subFolder)) as alias
if contents of subFolder is "Media" then
makeSubFolder(mainSF, MediaSubFolderList)
--set subSubFolder as (path to folder Audio) in (path to folder Media) in mainSF as alias
--set thePOSIX to POSIX path of ((path to mainSF as Unicode text) & "Audio")
--set theAlias to POSIX file thePOSIX as alias
--makeSubFolder(theAlias, AudioSubFolderList)
-- set path to folder "GFX" as alias
-- makeSubFolder(mainSF, GFXSubFolderList)
-- set path to folder "Tracks" as alias
-- makeSubFolder(mainSF, TracksSubFolderList)
else if contents of subFolder is "Post_Audio_PT" then
makeSubFolder(mainSF, PostAudioPTSubFolderList)
else if contents of subFolder is "Finishing" then
makeSubFolder(mainSF, FinishingSubFolderList)
end if
end repeat
--~~~~~~~~~~~~~~HANDLERS~~~~~~~~~~~~~~~~~~~~
--Makefolder handler
on makefolder(here, what)
tell application "Finder"
set the newFolder to ¬
(make new folder at here with properties {name:what})
end tell
return newFolder
end makefolder
--MakeSubFolder handler
on makeSubFolder(here, whatSet)
repeat with subSub in whatSet
my makefolder(here, (MasterFolderName & "_" & contents of subSub))
end repeat
end makeSubFolder