Page 1 of 1

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

PostPosted: Thu Dec 27, 2018 5:45 am
by Mache
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!

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

PostPosted: Thu Dec 27, 2018 12:47 pm
by Mr_Noodle
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.

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

PostPosted: Thu Dec 27, 2018 1:01 pm
by Mache
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

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

PostPosted: Thu Dec 27, 2018 1:43 pm
by Mache
I can create the rule to find the Pdf, but I get stuck on the rename box "rename (text box) with (text box)

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

PostPosted: Fri Dec 28, 2018 11:15 am
by Mr_Noodle
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.

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

PostPosted: Sat Dec 29, 2018 6:52 am
by Mache
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.

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

PostPosted: Mon Dec 31, 2018 11:25 am
by Mr_Noodle
If you post your rules, I can take a look and see what may be wrong with them.

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

PostPosted: Tue Jan 08, 2019 1:17 pm
by Mache
Hi Mr Noodle,

Unfortunately I deleted them...

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

PostPosted: Wed Jan 09, 2019 12:42 pm
by Mache
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!

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

PostPosted: Wed Jan 09, 2019 3:07 pm
by Robert
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

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

PostPosted: Thu Jan 10, 2019 4:17 am
by Mache
Hi Robert,

That works perfectly, thanks for you help and the screenshots, it was really kind.