Page 1 of 1

How to identify sheet music inside a PDF?

PostPosted: Wed May 27, 2015 5:53 am
by aetjansen
Hi All,

I have been very late the party and only discovered Hazel last week. But, like many others I am wondering why I haven't discovered this earlier. I really love it and have setup quite a few rules based on what I read on these forums. Particularly managing my desktop and downloads folder. But also identifying invoices in PDFs and archiving those in a folders.

However, I am now facing a challenge that I cannot seem to figure out on my own:
- I have a process where for all mails with a PDF attachment, the attachment gets saved to a folder.
- Several Hazel rules are applied to that folder (like identifying the aforementioned invoices)
- But, I also work a lot with sheet music and I would like to find a way to identify sheet music in a PDF and move that to a different folder for processing.

I cannot figure out a way to identify sheet music as I do not know of a pattern to match.

Is there anybody that may have a clue how to do this? Is it at all possible?

Regards,
AJ

Re: How to identify sheet music inside a PDF?

PostPosted: Wed May 27, 2015 1:21 pm
by Mr_Noodle
If you select the file in Finder and do "Get Info", that will show all the attributes available (make sure to look under "More Info". Maybe there's a field there you can use that distinguishes the sheet music files from the others.

Re: How to identify sheet music inside a PDF?

PostPosted: Fri May 29, 2015 4:13 am
by aetjansen
Thanks, I did look at those properties, but unfortunately there is nothing specific about (my) sheet music files. What I have done so far is to make a few rules that check the PDF for the names of known publishers and route into different folders based on that. But it hardly covers all the pieces, especially those that are especially arranged for me for example.

Another "way in" would be to see if a "music font" is present or something. That is how humans differentiate it from normal text, but I have no idea how to figure that out yet.

Re: How to identify sheet music inside a PDF?

PostPosted: Fri May 29, 2015 1:42 pm
by Mr_Noodle
Not sure about the specifics on how to do this, but search the forums for a script on detecting whether a PDF is ocr'ed or not. That searches the raw PDF text for font directives. You might be able to adapt that to your needs.

Re: How to identify sheet music inside a PDF?

PostPosted: Sat May 30, 2015 2:38 pm
by aetjansen
Thanks, that sounds like a way into more detailed PDF parsing. I was not aware of such script, thanks!