Hi, I have had a basic script that I have been using for a few years. It creates folders based on input and adds the input to the folder name.
I am trying to figure out how to create subfolders into one of the created folders in the script, without writing a new script to add those folders.
try
set jobName to text returned of (display dialog "Enter factory name:" default answer "")
set jobNum to text returned of (display dialog "Enter a batch number:" default answer "")
set tempName to (jobName & " " & jobNum)
set folderpath to POSIX path of (choose folder with prompt "Select client folder")
do shell script "/bin/mkdir -p " & quoted form of (folderpath & "/" & ¬
tempName & "/" & tempName & " ") & "{Files,Jpegs,Renders,Quote}"
end try
So once i create the folowing folders,
Job Name Job number Files
Job Name Job number Jepgs
Job Name Job number renders
Job Name Job number Quote
I would like to create the following folders,
Job Name Job number Quote / Job Name Job number Files
Job Name Job number Quote / Job Name Job number renders
I have tried using the shell script again, but it places my new sub-folders at the top level.
Any ideas, thanks.
Randy
Do you mean this:
try
set jobName to text returned of (display dialog "Enter factory name:" default answer "")
set jobNum to text returned of (display dialog "Enter a batch number:" default answer "")
set tempName to (jobName & " " & jobNum)
set folderpath to POSIX path of (choose folder with prompt "Select client folder")
do shell script "/bin/mkdir -p " & quoted form of (folderpath & "/" & ¬
tempName & "/" & tempName & " ") & "Quote/{'" & tempName & " Files','" & tempName & " renders'}"
end try
Thanks Stefan,
this works for me.
try
set jobName to text returned of (display dialog "Enter factory name:" default answer "")
set jobNum to text returned of (display dialog "Enter a batch number:" default answer "")
set tempName to (jobName & " " & jobNum)
set folderpath to POSIX path of (choose folder with prompt "Select client folder")
do shell script "/bin/mkdir -p " & quoted form of (folderpath & "/" & ¬
tempName & "/" & tempName & " ") & "{Files,Jpegs,Renders,Quote}"
do shell script "/bin/mkdir -p " & quoted form of (folderpath & "/" & ¬
tempName & "/" & tempName & " ") & "Quote/{'" & tempName & " Quote_Files','" & tempName & " Quote_Renders'}"
end try
Great & Best Regards, Randy
It was unclear whether you want to keep the other folders. This does the same:
try
set jobName to text returned of (display dialog "Enter factory name:" default answer "")
set jobNum to text returned of (display dialog "Enter a batch number:" default answer "")
set tempName to (jobName & " " & jobNum)
set folderpath to POSIX path of (choose folder with prompt "Select client folder")
do shell script "/bin/mkdir -p " & quoted form of (folderpath & "/" & ¬
tempName & "/" & tempName & " ") & "{Files,Jpegs,Renders,Quote/{'" & tempName & " Quote_Files','" & tempName & " Quote_Renders'}}"
end try
Thanks again, that was what I was trying to do, but I just wasn’t sure how to add the subfolders to the Quote folder only.
Randy