Hello!
I’m looking to finesse a script I have and am looking for some help.
Basically I would like to have the number sequence come before the name…and if possible.have a leading zero for numbers 1-9 (example 01_New_Folder). Currently the script generates the following naming - New_Folder_1.
I would never exceed creating more than 99 folders so I’m only interested in creating a 2 digit number prefix.
My basic AppleScripting skills are proving this task to be difficult for me.
Any guidance would be helpful!
-Aaron
set folderMaker to text returned of (display dialog "Please enter root folder name:" default answer "Folder Maker")
set loc to (choose folder "Choose Parent Folder Location" default location (path to desktop folder) as alias)
tell application "Finder"
set newFolder to make new folder at loc with properties {name:folderMaker}
end tell
repeat
set subCount to text returned of (display dialog "How many folders?" default answer 10)
try
if subCount ≠"" then
subCount as integer
exit repeat
end if
end try
end repeat
set folderName to text returned of (display dialog "Please enter sub folder base name:" default answer "New_Folder")
repeat with i from 1 to subCount
tell application "Finder" to make new folder at newFolder with properties {name:folderName & "_" & i}
end repeat