How to create multiple folders with AppleScript

For a project I needed create 5000 folders. Needless to say that I certainly did not want to do this manually. After searching on Google I combined two AppleScripts. This new script creates multiple folders in the front window.

try
tell application “Finder” to set the this_folder ¬
to (folder of the front window) as alias
on error — no open folder windows
set the this_folder to path to desktop folder as alias
end try
repeat with i from 1 to 100
tell application “Finder”
make new folder at this_folder with properties {name:”xyz” & i}
end tell
end repeat

Leave a Reply

Your email address will not be published. Required fields are marked *