Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating nested folders with variable names using Applescript/mkdir
    text
    copied!<p>I'm trying to create an applescript that prompts for a job name, then a desired directory in which to create a folder with the job name. It then should create a series of subfolders within the initial folder with names such as "job name-Links" &amp; "job name-PDFs" etc.</p> <p>I've cobbled this script together from different sources &amp; would like feedback on how to improve it, because I'm sure it's ugly as sin.</p> <pre><code>tell application "Finder" activate set jobNum to text returned of (display dialog "Enter a job number:" default answer "[JobNumber]-[Description]") set folderpath to POSIX path of (choose folder with prompt "Select client folder") do shell script "/bin/mkdir -p " &amp; quoted form of folderpath &amp; "/" &amp; quoted form of (jobNum) &amp; "/" &amp; quoted form of (jobNum &amp; "-Links") do shell script "/bin/mkdir -p " &amp; quoted form of folderpath &amp; "/" &amp; quoted form of (jobNum) &amp; "/" &amp; quoted form of (jobNum &amp; "-PDFs") do shell script "/bin/mkdir -p " &amp; quoted form of folderpath &amp; "/" &amp; quoted form of (jobNum) &amp; "/" &amp; quoted form of (jobNum &amp; "-Supplied") do shell script "/bin/mkdir -p " &amp; quoted form of folderpath &amp; "/" &amp; quoted form of (jobNum) &amp; "/" &amp; quoted form of (jobNum &amp; "-Versions") end tell </code></pre> <p>Any thoughts &amp; comments would be greatly appreciated. This is my first attempt at a script. I thought I'd post this because I've hunted for this specific use case for ages and only found bits and pieces. Hopefully someone can help me out so other will find it useful too.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload