Recent

Author Topic: Automator New Folder and Subfolders?  (Read 1119 times)

0 Members and 1 Guest are viewing this topic.

Offline AaronH

  • Sr. Member
  • ****
  • Posts: 497
  • Gender: Male
Automator New Folder and Subfolders?
« on: January 29, 2019, 12:39:46 PM »
Hey guys, I was wondering if anyone knew how to do what I'm trying to do.

Basically, I'm trying to create an action in Automator that would create a folder in the current finder window, name it 0000_Job, then create four subfolders within it with their own names. Is this possible? I'm trying to minimize how frequently I have to move windows to get to the desktop to copy a folder I have on my desktop.

If the automator thing isn't possible, is it possible to have some sort of shortcut to copy this folder from my desktop with a click of an icon in the finder window toolbar?

Thanks!
Aaron
Mac & Windows | XMF | Fiery | Oris

Offline DigiCorn

  • Terrorizing humans since 1971
  • Supreme Ninja
  • ***
  • Posts: 15164
  • Gender: Male
  • There is no Dana, only Zul!
    • Clerks.
Re: Automator New Folder and Subfolders?
« Reply #1 on: January 29, 2019, 01:54:02 PM »
Not sure entirely what you need it for, but I just have a folder on my server called "New Folder on Sever" with all the subfolders inside I need. Then I just copy it and rename as needed to the desired location.
"Selling my soul would be a lot easier if I could just find it."
– Nikki Sixx

“Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut.”
― Ernest Hemingway

Online scottrsimons

  • Prepress/IT/Automation
  • Sr. Member
  • ****
  • Posts: 323
  • Gender: Male
  • 42
Re: Automator New Folder and Subfolders?
« Reply #2 on: January 29, 2019, 02:09:25 PM »
I do the same as DigiCorn. Much easier than Automater, which I used to do too.
Mac • Prinergy 8 • Preps 8 • RBA • Fusion Pro

"Your superior intellect is no match for our puny weapons!" - Homer J. Simpson

"If you don't do anything you can't screw anything up." Joe

Offline zox

  • Jr. Member
  • **
  • Posts: 70
  • Gender: Male
Re: Automator New Folder and Subfolders?
« Reply #3 on: January 29, 2019, 02:16:45 PM »
Put this into script editor and save it.

I modified existing script that actually ask you docket number to dumb it down to write always 0000_Job

Code: [Select]
tell application "Finder"
try
set currentfolder to (folder of the front window as string)
on error
display dialog "This script will not work on the desktop. Please navigate to a folder and run the script." with icon stop buttons {"Cancel"}
end try
set jobname to "0000_Job"
try
make new folder at currentfolder with properties {name:jobname}
on error
display dialog "That folder already exists" with icon stop buttons {"Cancel"}
end try
set jobfolder to (folder (currentfolder & jobname) as string)
make new folder at jobfolder with properties {name:"FOLDER1"}
make new folder at jobfolder with properties {name:"FOLDER2"}
make new folder at jobfolder with properties {name:"FOLDER3"}
make new folder at jobfolder with properties {name:"FOLDER4"}
open jobfolder
set the current view of Finder window jobname to list view
end tell


I hope this helps

Offline Kermy812

  • New Member
  • *
  • Posts: 39
Re: Automator New Folder and Subfolders?
« Reply #4 on: January 29, 2019, 03:17:11 PM »
Not an expert with automator - It seem like I do things with automator like one a year... I think this might be what you want:
https://www.macworld.com/article/2038095/5-automator-workflows-everyone-should-have.html
Go to the section "Create subfolder"
You then can create a automator service, so you can right click on a folder to run that service to make your sub folders in it.
Watch out! I was playing around and didn't select check "ignore input" as it says there, when it the copied a few thousand files from my path into in it - Yikes!

Offline AaronH

  • Sr. Member
  • ****
  • Posts: 497
  • Gender: Male
Re: Automator New Folder and Subfolders?
« Reply #5 on: January 29, 2019, 05:31:29 PM »
Awesome! Thanks guys. I'll give these a shot.
Mac & Windows | XMF | Fiery | Oris

Offline Skovby

  • New Member
  • *
  • Posts: 2
Re: Automator New Folder and Subfolders?
« Reply #6 on: January 10, 2020, 02:19:55 AM »
Great!

I would like a script, pretty simlular to the one above.

But when I run the script, I would like the possibility to enter what the name of the folder shold be (specific job name), before it creates it and the four subfolders which always has the same names.

Is that possible?

Offline Skovby

  • New Member
  • *
  • Posts: 2
Re: Automator New Folder and Subfolders?
« Reply #7 on: January 10, 2020, 02:28:06 AM »
Somthing like this maybe

It just needs to make the folder and subfolders in the specifik folder I am in when running the script. This script asks where to put the folder, I don't won't it to do that. I would just like the script to put the new folder (with custom name) and the subfolders (always same names) it in the current folder, and open new folder with the name I've given it, in the samme window, so I can see the subfolders when the script is done.

tell application "Finder"
    set JobName to text returned of (display dialog "Please enter Job Name:" default answer "Job_Name")
    set loc to choose folder "Choose Parent Folder Location"
    set newfoldername to JobName
    set newfo to make new folder at loc with properties {name:newfoldername}
    make new folder at newfo with properties {name:"Job Materials"}
    make new folder at newfo with properties {name:"Previews"}
    make new folder at newfo with properties {name:"PSDs"}
    make new folder at newfo with properties {name:"VX"}
end tell
« Last Edit: January 10, 2020, 03:07:49 AM by Skovby »

Offline swampymarsh

  • Full Member
  • ***
  • Posts: 160
Re: Automator New Folder and Subfolders?
« Reply #8 on: January 13, 2020, 11:18:17 PM »
Using the script supplied by ZOX, I just created an Automator workflow/service so that I could right click in the Finder to create the new folder/subfolder structure.

I have attached a zip of the .workflow file and screenshot if this helps.

Offline AaronH

  • Sr. Member
  • ****
  • Posts: 497
  • Gender: Male
Re: Automator New Folder and Subfolders?
« Reply #9 on: January 16, 2020, 02:16:54 PM »
Fancy! Thanks swampymarsh!
Mac & Windows | XMF | Fiery | Oris