Jump to content
sepulchra

Folder Directory Workflow

Recommended Posts

I've attached a screen shot an automator workflow that a bunch of folders and subfolders. it prompts the user to name the parent folder and choose a destination. I'm wondering if there is a way to accomplish this completely within an alfred workflow? 

Screen Shot 2018-11-30 at 7.01.40 PM.png

Share this post


Link to post

Yes, it is. If you want to use Alfred to pick the destination directory, you should implement it as a File Action, i.e. select a directory in Finder or Alfred (or most other apps), then you can run Alfred's File Actions on it and choose "Create New Folders…" (or whatever) to run your workflow.

 

FWIW, mkdir has a -p option to create intermediate directories, and you can use {...} for multiple directories, so:

mkdir -p "$1/$2/{INTV,TRACKING,MUX SFX,RAW TAPE,SELECTS}"
mkdir -p "$1/$2/SESSIONS/{CHAP 1,CHAP 2, CHAP 3,CHAP 4,CHAP 5,STRINGOUTS}"

should create all of your directories with less typing.

Share this post


Link to post

@deanishe thank you! I managed to get that to work. It creates the folders! I'm new to this, is there a way to choose the destination directory and then pass a {query} that names the parent folder these folders would reside with. i.e.

 

 - navigate to directory 

- choose file action

- type file name of project folder name

- run mkdir scripts 

 

I'm just stabbing in the dark.

 

Share this post


Link to post
19 minutes ago, sepulchra said:

type file name of project folder name

 

Store the incoming query (the directory path) in a variable, then use a Keyword to ask for the name of the parent directory. Now you can access both variables from your script.

Share this post


Link to post
5 hours ago, deanishe said:

 

Store the incoming query (the directory path) in a variable, then use a Keyword to ask for the name of the parent directory. Now you can access both variables from your script.

I'm afraid i am now in over my head. I'm not sure how to store the path i navigated to within alfred in a variable and then then use a Keyword to ask for the name of the parent directory. And modify the script to accept those variables. I apologize but i am learning as i go.

Edited by sepulchra

Share this post


Link to post

Thanks for that. It gives me something to review so i can understanding some basic shell scripting. I appreciate that. To date. I have just been grabbing bits here an there to make stuff work.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...