You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Help with Automator and creating folder structure

Hi All,


I previously have used a little script to create a series of folders with common names but a user entered prefix - after upgrading to Mojave this no longer works... I have been trying to re-create in Automator but cannot seem to get the script to include the user entered Job Number in the sub folder names - can anyone help?


Thanks.


MacBook Pro with Touch Bar

Posted on Sep 24, 2019 8:20 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 26, 2019 8:49 AM

mkdir -p "$1/$2/$2 Images"
mkdir -p "$1/$2/$2 References"
mkdir -p "$1/$2/$2 Copy"


Although if you are in a job folder, it seems redundant to name the folders with the jobname in them, but I believe the preceding will do what you want.

Similar questions

5 replies

Sep 24, 2019 10:49 AM in response to Grae London

All you need to do with that workflow is change the mkdir syntax to generate the subfolders. I tested your workflow and it works once this change is made.


mkdir -p "$1/$2/Images"
mkdir -p "$1/$2/References"
mkdir -p "$1/$2/Copy"


Something that I do before I write any functional code in the Run Shell Script action is to send the arguments to a Desktop text file to confirm that the arguments are in the right order.


echo $1 > ~/Desktop/audit.txt
echo $2 >> ~/Desktop/audit.txt


Now you can Quick Look the audit.txt file and adjust your workflow if necessary for the right argument order. It is purely optional to either comment, or remove these two lines from the beginning of the action.



Sep 24, 2019 11:47 PM in response to VikingOSX

Hi, Thanks for the quick reply!


That works in that it creates the folders, but ideally I want to add the job number top each folder name - sorry, probably me not being clear!


With job number FS001, at the moment it creates:


FS001>Artwork

FS001>Copy

FS001>Images

FS001>Reference


Ideally I'd like it to create:


FS001>FS001 Artwork

FS001>FS001 Copy

FS001>FS001 Images

FS001>FS001 Reference


So adding the user entered job number as a prefix to each sub-folder name. Is that possible?


Thanks again for your help!




Help with Automator and creating folder structure

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.