Okay so this script works:
property prefix : ""
set folderpath to choose folder with prompt "Choose Destination Folder"
repeat
set prefix to text returned of (display dialog "Enter Prefix:" default answer "")
tell application "System Events" to exists folder prefix of folderpath
exit repeat
end repeat
set folderHierarchy to "/{" & folderName("Projects") & ¬
"," & folderName("Raws") & ¬
"," & folderName("Final Exports") & "}"
do shell script "/bin/mkdir -p " & quoted form of POSIX path of folderpath & "/" & quoted form of prefix & "/" & folderHierarchy
on folderName(v)
return quoted form of (v)
end folderName
I tried to set a dafault path instead of the user having to select the path. This is what I did:
property prefix : ""
set folderpath to POSIX path of ("/Volumes/HPT-RAID5")
repeat
set prefix to text returned of (display dialog "Enter Prefix:" default answer "")
tell application "System Events" to exists folder prefix of folderpath
exit repeat
end repeat
set folderHierarchy to "/{" & folderName("Projects") & ¬
"," & folderName("Raws") & ¬
"," & folderName("Final Exports") & "}"
do shell script "/bin/mkdir -p " & quoted form of POSIX path of folderpath & "/" & quoted form of prefix & "/" & folderHierarchy
on folderName(v)
return quoted form of (v)
end folderName
And I keep getting this error: “Can’t make “testerrrrrrr” into type integer.”
Where ‘testerrrrrr’ is the name I choose for the “prefix”
Any tips? The original thread I pulled this from suggested this:
But I can’t make much sense of it (beginner here)
Thanks for any help, guys.