Select text on Pdf after Re: (Just the one line)

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

Moderator: Mr_Noodle

Hi, I just bought Hazel and am very impressed! I receive many letters in pdf with generic numbers as the file name, I would like to rename them with the actual subject of the letter which always starts with Re: (then the actual subject, always on one line). Is it possible to find then use that subject to rename the file?

Thanks in advance for your help for what I am sure is a basic question, for which I am struggling to get my head around!
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

That should be doable. Look up "match patterns" in the help. You can create a pattern to capture the text after the "Re:" into a custom attribute which you can then use to rename the file.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thats wonderful, thanks for a speedy reply! If you can give a little pointer as to what that actually means...

I understand the match patterns, but not how to create the pattern I need, as the result will always be variable
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

I can create the rule to find the Pdf, but I get stuck on the rename box "rename (text box) with (text box)
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

Are you referring to the "Replace text" function? You should need that here. Use the "Rename" action. In the text box there you can specify a pattern. When using the match pattern, you should have created a custom attribute to match the subject line. That custom attribute should be available to use in the rename pattern.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr Noodle,

Thanks again for your help, but as I have just had Hazel for a week and I am spending a disproportionate amount of time trying unsuccessfully accomplish this "rename", I have decided to ditch the re-name and just do a search instead.

I will just use Hazel to move things around.

Thanks again for your help.
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

If you post your rules, I can take a look and see what may be wrong with them.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr Noodle,

Unfortunately I deleted them...
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

Hi Mr_Noodle,

I have tried to re-create the rules:

If all of the following conditions are met

If name starts with CB-
If source/url is

Do the following
Rename with pattern Replace Name with Re: (anything)


When the rule operates it finds the file correctly and re-names it to -1

I hope that is of help and again thanks for your patience!
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am

Maybe that helps: You have to look for contains, contain match, custom text. There you enter the RE: (Anything).

This becomes a token you can use in the renaming process.

Image

Image
"Behind all the inhuman aspects of automation (...) its real possibilities appear: the genesis of a technological world in which man can finally withdraw from (...) the apparatus of his labor – in order to experiment freely with it." /Marcuse
Robert
 
Posts: 52
Joined: Sun Dec 16, 2018 8:05 am

Hi Robert,

That works perfectly, thanks for you help and the screenshots, it was really kind.
Mache
 
Posts: 7
Joined: Thu Dec 27, 2018 5:38 am


Return to Support