Resolved Use Automator to Create Dated Folders?

Discussion in 'Mac Programming' started by E39SourceRyan, Oct 2, 2016.

  1. E39SourceRyan macrumors newbie

    E39SourceRyan

    Joined:
    Oct 2, 2016
    Location:
    Hudson, Ohio
    #1
    I back up my daily-created videos on a backup hard drive. The videos are organized in a folder system (attached screenshot) by year, month, day of month. I am very tired of creating a new folder each and every day of the year manually (10.1 Saturday, 10.2 Sunday, etc etc). There must be a way to automate this process in automator. I would appreciate any guidance!!
     

    Attached Files:

  2. Starfia macrumors 6502

    Starfia

    Joined:
    Apr 11, 2011
    #2
    I do something similar with my own video log, but it's much simpler; I use one folder per year, and include the full date in the log's name. (So I just name the file myself, then have an Automator workflow move it to the current year's folder; then each year, I update the workflow.)

    But you might be able to achieve what you're after using Automator alone – the "New Folder" and "Rename Finder Items" actions will do at least a bunch of that work. (Finishing with "Reveal Finder Items" is always a nice affirmation that things are working while you're testing, as well.)

    I'm not sure off-hand about how you'd deal with the conditional non-recreation of folders that already exist.
     
  3. computiNATEor macrumors newbie

    computiNATEor

    Joined:
    Nov 5, 2015
    Location:
    Orange County, CA
    #3
    Honestly, I'm a bit puzzled why you chose to store each Vlog file in a separate folder. Even sorting by month would seem like a more logical, less troublesome route. Simply adding the dates to the filename would be an easy way to keep them organized. I could probably put together an AppleScript/Automator workflow to help with that, too. :)

    Either way, I spent a few hours learning how to use AppleScript and its "date" function. Pretty easy, honestly, especially compared to the (more powerful) Java and Python I'm used to using. This little applet runs quickly and efficiently, and it will create folders inside a "2017" folder (for example).

    - Download the "Create Folders for a Year" zip file that I've attached below.
    - There are three files inside that zip file; the AppleScript itself, an Automator applet, and an RTF file with the AppleScript as well.
    - Now, when you double click on the applet (titled "Create Folders"), it will say you can't run it because it doesn't come from a "identified developer" (because it comes from me). To get around that, right-click > "Open". Then click "Open" again.
    - The applet will ask for a year. If you specify a year where folders already exist (say, 2014), the applet will crash ("The action "Run AppleScript" encountered an error."), so it won't overwrite any files (or at least it shouldn't).
    - The applet will then ask to be pointed at the folder where it will create the 12 monthly folders and various daily sub-folders. I assume you can create a yearly folder on your own. :)
    - Wait about 10 seconds (maybe less, maybe more). You will see a little "gear" icon spinning in the menu bar. When that icon disappears, your folders are ready!

    Ta-da!
     

    Attached Files:

  4. E39SourceRyan thread starter macrumors newbie

    E39SourceRyan

    Joined:
    Oct 2, 2016
    Location:
    Hudson, Ohio
    #4
    NATE!! I am beyond impressed. This is exactly what I wanted. Thank you SO much for putting this together, and into my hands. I will likely use this for a very long time (albeit once a year lol). If you can do this, you should start a YouTube channel or something about how to use automator this complexly. It'd be lucrative. Again, thanks so much for this!
     
  5. computiNATEor macrumors newbie

    computiNATEor

    Joined:
    Nov 5, 2015
    Location:
    Orange County, CA
    #5
    You're very welcome! Hehe, I didn't use Automator for much of it; mostly programming in AppleScript. Automator is simply a GUI for using AppleScript's power, which has been built into each Mac for a very long time, now.
     

Share This Page