Features request: FIles in Mail, text extraction

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

1) Be able to check for attachments in e-mails (in Mail or any other App).
2) Search and extract text within files and use this for (e.g.) file names.
netmex
 
Posts: 3
Joined: Thu Oct 28, 2021 1:10 am

1) It's a bit tricky as the internal storage of such things are not usually documented and can change. It's usually better to do that on the Mail side, via its rule system.

2) That can be done now via pattern matching on the contents and custom attributes.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

1) Would someone mind posting a working Apple Scrip for that?

2) Not sure if you got my idea right. Let's say I have a line in a document "referencenumber: 1234567" and I need that number. How would I "read" this string and use that string in a file name?
netmex
 
Posts: 3
Joined: Thu Oct 28, 2021 1:10 am

Did you check the chapter on match patterns? Use "Contents contain match" with a match pattern. Use a custom attribute (described in the same chapter) to match the part of the text you want to re-use.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion