The following script uses the folder path saved in the clipboard to create the “untitled folder” with subfolders. The script works fine and I would like to modify it but I am not sure how to make the change. Basically, I would like the script to create 4 untitled folders sets instead of 1.
Can someone please help me figure out if this change is possible with the script?
====================
Current folder creation (1 untitled folder set)
untitled folder
Concept 1
– Subfolders
Concept 2
– Subfolders
Concept 3
– Subfolders
Concept 4
– Subfolders
====================
New folder creation (4 untitled folder sets)
untitled folder 1
set posixPath to text 1 thru -2 of (the clipboard)
set folderStructure to quoted form of posixPath & “/{‘Concept 1’,‘Concept 2’,‘Concept 3’,‘Concept 4’}/{ASSETS,MARKUP,PRODUCTION,REVIEW,TRASH}”
do shell script "/bin/mkdir -p " & folderStructure
I think this will give you the results you were looking for, as long as there is a posix path on your clipboard.
set posixPath to ((the clipboard) & "/")
set newFolder to "Untitled Folder "
set hfsPath to posixPath as POSIX file as text
do shell script "cd " & quoted form of posixPath & " ;mkdir -p " & ¬
quoted form of newFolder & "{1..4}" & "\"/Concept \"" & ¬
"{1..4}/{ASSETS,MARKUP,PRODUCTION,REVIEW,TRASH}"
wch1zpink’s script works great; the following is another option. This assumes that posixPath is the parent folder of the four folders entitled “untitled folder 1” thru “untitled folder 4”.
set posixPath to text 1 thru -2 of (the clipboard)
set folderStructure to quoted form of posixPath & "/{'untitled folder 1','untitled folder 2','untitled folder 3','untitled folder 4'}/{'Concept 1','Concept 2','Concept 3','Concept 4'}/{ASSETS,MARKUP,PRODUCTION,REVIEW,TRASH}"
do shell script "/bin/mkdir -p " & folderStructure
BTW, the OP’s original script was written by StefanK in:
Thank you both for your help. Both solutions work. The last solution is easier to implement. I’m testing the first solution to make it work with the Adobe Bridge App. Many thanks again!
The original question was about executing a folder creation script at the folder path stored in the clipboard. I’m trying to make sense of an alternative way to achieve a similar result with a zip file.
Instead of executing the folder creation script, is it possible to execute a zip file that contains the folder structure at the location stored in the clipboard?
If the location of the zip file is constant, for example, in the Documents folder.
Can the script copy the zip file to the target location stored in the clipboard?
Example
Copy target location to clipboard (Desktop)
Get zip file location (Documents/foldert.zip)
Copy (folder.zip) file to target location (Desktop)
Extract (folder.zip) file
Remove (folder.zip) file