Move old files with specific strings in filenames

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi all,

I'm new to Hazel and have been trying to figure this out all night, but I can't. Please help!

Here's my situation: I work on a TV show and get multiple versions of scripts for each episode. I have a "scripts" folder to which I save everything, and I want Hazel to move the old versions of each script to a folder called "old."

The episodes are numbered, starting with 101 and ending with 110. The scripts will have names like this:

Seinfeld 105 Blue Draft [Date]
Seinfeld 105 Yellow Draft [Date]
Seinfield 105 Pink Draft [Date]
Seinfield 104 Yellow Draft [Date]
Seinfield 104 Pink Draft [Date]

(The show isn't "Seinfeld." I'm just using that title as an example.)

What I want Hazel to do is move all the old versions of each script -- so, the old 101 scripts, the old 102 scripts, the old 103 scripts, etc. What I want left in the "scripts" folder is just the newest version of each script.

I can't figure it out! I've tried making subfolders and going through them, but that seems problematic, too.

Any help would be greatly appreciated!

Thanks so much,
JMS
jms181
 
Posts: 1
Joined: Sun Feb 01, 2015 11:51 pm

You can try doing something like:
Code: Select all
  If (all) match
    Name matches (...)(•episode date)
    (•episode date) is not among the 1 most recent
  Do
    Move to "old"


•episode date is a custom date attribute you create to match the date at the end. The problem with this, though is that it gets the one most recent script overall. There's no way currently to limit that by episode unless you put the scripts for each episode into their own folder and have Hazel go into each folder.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support