Page 1 of 1

Automatically rename receipts to Merchant Name?

PostPosted: Fri Oct 21, 2016 4:05 am
by Cascades42
Hi!

I've been scratching my brains to try to figure out how to automatically extract the merchant name (e.g. Apple, Amazon...) from a document. Within the Hazel renaming attributes I found "Merchant Name", but when using it this part of the file name gets left blank. Despite google searching I'm not finding anything - except people trying to sell me witch hazel extract, I don't know when the feature was introduced or I'd try to read the release notes (but searching those reveals nothing either).

Can anyone suggest a solution beyond "one rule per vendor" which will allow this to work? All the documents in question are PDFs created from emails or PDF invoices, which means they are all OCRed.

Running macOS Sierra, non-beta as well, should that help.

Thank you in advance! :)

Re: Automatically rename receipts to Merchant Name?

PostPosted: Fri Oct 21, 2016 10:32 am
by Mr_Noodle
Note that those attributes are provided by the OS, not Hazel. I'm guessing some app provides that but that doesn't mean that other apps know about it and provide it as well. So chances are it won't be applicable to most files.

You'll probably have to try and match contents. If the name you are looking for is in the same place in all the documents, then you might be able to get away with a single rule instead of one per vendor but that depends heavily on the documents in question.

Re: Automatically rename receipts to Merchant Name?

PostPosted: Fri Oct 21, 2016 3:45 pm
by Cascades42
Mr_Noodle wrote:Note that those attributes are provided by the OS, not Hazel. I'm guessing some app provides that but that doesn't mean that other apps know about it and provide it as well. So chances are it won't be applicable to most files.

You'll probably have to try and match contents. If the name you are looking for is in the same place in all the documents, then you might be able to get away with a single rule instead of one per vendor but that depends heavily on the documents in question.


Thanks! I was hoping that you had somehow written the magic script which could identify merchant names within a PDF :P

I'll just make one rule per vendor - thankfully I don't shop in all that many places so it shouldn't take too long :)

Re: Automatically rename receipts to Merchant Name?

PostPosted: Thu Dec 01, 2016 11:17 am
by kites30
Mr_Noodle wrote:Note that those attributes are provided by the OS, not Hazel. I'm guessing some app provides that but that doesn't mean that other apps know about it and provide it as well. So chances are it won't be applicable to most files.

You'll probably have to try and match contents. If the name you are looking for is in the same place in all the documents, then you might be able to get away with a single rule instead of one per vendor but that depends heavily on the documents in question.



Hi, i have a question to your comment of that company issue.

How have to be the rule if i always want to use the first word in an ocred pdf file for using to rename my file?
Thanks a lot
br Alex

Re: Automatically rename receipts to Merchant Name?

PostPosted: Thu Dec 01, 2016 11:55 am
by Mr_Noodle
You could try matching something like "(anything) " (note the space at the end). That will match the first sequence of characters up to the first space.