How to: Batch create multiple folders on Mac OS X 10.7 Lion

by on Nov.04, 2011, under How to

Use applescript, compile and run:

set theDestinationFolder to choose folder
set theListOfValues to {“Nome of folder 1”, “Name of folder 2”, “Name of folder 3”}
tell application “Finder”
repeat with theCurrentValue in theListOfValues
make new folder at theDestinationFolder with properties {name:theCurrentValue}
end repeat
end tell

You can also use a .csv file:

set mgCSVfile to choose file

open for access mgCSVfile
set mgList to (read mgCSVfile)
close access mgCSVfile

tell application “Finder”
repeat with x from 1 to count paragraphs of mgList
set mgFolder to container of mgCSVfile as text
set text item delimiters of AppleScript to “,”
set mgThisList to text items of paragraph x of mgList as list
set text item delimiters of AppleScript to “”

repeat with i from 1 to count mgThisList
if item i of mgThisList is not “” then
set mgSubFolder to item i of mgThisList
if (exists folder mgSubFolder of folder mgFolder) is false then
make new folder at mgFolder with properties {name:mgSubFolder}
end if
set mgFolder to (folder mgSubFolder of folder mgFolder) as alias
end if
end repeat

end repeat
end tell

VN:F [1.9.22_1171]
Rating: 5.0/5 (6 votes cast)
VN:F [1.9.22_1171]
Rating: +5 (from 5 votes)
How to: Batch create multiple folders on Mac OS X 10.7 Lion, 5.0 out of 5 based on 6 ratings
  • Facebook
  • Twitter
  • Google
  • Google Reader
  • Live
  • LinkedIn
  • Technorati
  • Blogger
  • Delicious
  • Digg
  • Add to favorites
  • Email
  • Print
  • RSS

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!