I am running Hazel 4.0.5 . I have a series of rules that file credit card receipts. The goal of this particular rule is to rename the receipt with the date of transaction and the Payee and auto-file it into the appropriate folder
In the first IF section of the rule, I have several lines that check for commonly used Payee names. At the very end of this section, I simply check for the existence of a space. All of these lines use "Contents" "Contain Match" and assign to Payee.
In the rename section, I rename to "Credit Card Name (Payee) IncrementalNumber.Extension"
If the series of Ifs match a common payee, then the file is renamed with that payee. Otherwise, since most receipts would contain a space of some sort and the last IF checks for a space, then if Hazel cannot find a common payee name, then the section of the renamed file that would normally contain a payee name surrounded by a left and right parentheses, I should (and most times do just get a left and right parentheses in the file name. For example, if Hazel could not find a common payee name then the renamed file might be something like "2016-09-17 Chase Visa ( ) 354.pdf"
Most of the time this works fine. When it doesn't work, Hazel seems to rename the file with a (space + carriage return) so the end result would be something like:
"2016-09-17 Chase Visa (
) 354.pdf"
So when you view the file name on the Mac, in the above example you would see just
"2016-09-17 Chase Visa (
You have to click on the file name after the right parentheses and remove the "hard carriage return" so that the file name displays all on one line.
Something that makes this problem even worse is that when it creates this goofy filename with the "hard carriage return" in it, it is creating it in a folder that is actually a Microsoft OneDrive folder and those filenames with the "hard carriage returns" in them do not sync until the offending character is removed.
So with all of the above said, I am looking for some answers.
1. Is there a better way to do what I am trying to do?
2. When I am matching known payee names and find none, I would rather rename the file with something like (no-match) or something but I don't see any way to do that. It is my understanding that the Payee variable is just going to be the contents of the match and that I don't have any way of changing it to some default value. That is why I just checked for a space which should be pretty common
3. Sometimes on one given receipt, I can scan it several times and some of the time, it will work just fine with a nice pair of parentheses but 9 times out of 10, that same receipt will somehow be renamed with a "hard carriage return"
Any ideas would be appreciated.
Thanks,
Rod