Automating folder creation

Joined
Sep 8, 2016
Messages
3
Reaction score
0
Here is what I need to do: Drag a file on a workflow that will create a folder by the same name as the file and then place that file in that folder, inside another folder named “mr”. As well as creating some other folders named ff/Hires and “NX”.

Example attached.

upload_2016-9-8_14-36-39.png
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,105
Reaction score
497
Hello and welcome.

I am not very well-versed in Automator/AppleScript. Maybe the folks over at MacScripter could lend a hand in creating that workflow.

C
 
Joined
Sep 8, 2016
Messages
3
Reaction score
0
Cory,
Thanks for the reply. My IT guy ended up making something I can run on a windows box with Power Shell. Here is he code he made:

echo off
$from = "createfolder_in"
$to = "createfolder_out"
$files = get-childitem "$from\*"
ForEach ($file in $files) {
$dirname = $file.BaseName
New-Item -Path $to\$dirname -type directory
New-Item -Path $to\$dirname\ff -type directory
New-Item -Path $to\$dirname\ff\Hires -type directory
New-Item -Path $to\$dirname\mr -type directory
New-Item -Path $to\$dirname\NX -type directory
Move-Item $file $to\$dirname\mr
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top