Replacing a custom date

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

Moderator: Mr_Noodle

Replacing a custom date Wed Jun 01, 2016 8:11 pm • by skery
Hi there,

I'm trying to use Hazel to rename files that are scanned by my copier, which automatically names each file MMDDYYYY-file name.pdf and I can't tell it not to include the date.

So I see how hazel can find the date in a file, and then launch the replace text, but when I get to replacing the text, I just don't see how I can do what I want. What I want is just to delete the MMDDYYYY- and leave the remaining text. Each scan is a different document, for different clients, and the date I want on the filename is not the scan date but the execution date, which at this point I'm not yet interested in automating.

when I go click on the name attribute arrow, and select replace text, I can't use the custom date token in there, I'd be happy to have it just delete the first 9 characters...

could I somehow instead parse the filename and use that as a custom token somehow? the problem is its not a set number of characters, each document is customized to the execution date, client and the name of the document.

It's my first time using hazel so be kind! thanks
skery
 
Posts: 3
Joined: Wed Jun 01, 2016 7:59 pm

Re: Replacing a custom date Thu Jun 02, 2016 10:37 am • by Mr_Noodle
Create a pattern to match the date part, then use a custom attribute to match everything afterwards. You can then use that custom attribute in the rename action.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Replacing a custom date Thu Jun 02, 2016 12:07 pm • by skery
Mr_Noodle wrote:Create a pattern to match the date part, then use a custom attribute to match everything afterwards. You can then use that custom attribute in the rename action.


Thanks I figured it out. I wasn't using the anything tag as a custom token which then allowed me to rename based in the anything custom token. Worked great!!
skery
 
Posts: 3
Joined: Wed Jun 01, 2016 7:59 pm


Return to Support