If.. Then.. Way of Setting a token/variable for use in file

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

Moderator: Mr_Noodle

This could be done with two rules, but would be neater if I could just use one.

I am using hazel to rename and file share pdf contract notes. They contain the text 'Buy' or 'Sell' in a box on their own.

Date matching, account number matching on the PDF works fine.

What I would like to do is get the words 'Buy' or 'Sell' into the file name so format is something like this:

yy-mm-dd - Contract Note - Buy.pdf

or

yy-mm-dd - Contract Note - Sell.pdf

In reality the filename is a bit more complicated than that (in case there is more than one transaction a day).

It could be done with two rules but is there a way to do it with one?

Thanks

Phil
philrob
 
Posts: 8
Joined: Sun Jun 24, 2012 3:39 am

You could try using a single rule with two conditions. Each condition can match either pattern and use "any" so that only one needs to match. You can then use the custom tokens from both in the rename pattern. Only one will have a value at a time.

In the future, I'm considering adding the ability to have multiple patterns associated with a custom token, which would make this type of thing much more compact. There are also other implications but overall, things would end up a bit cleaner.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support