Page 1 of 1

Nested Rules and different names for a same pattern

PostPosted: Thu Feb 18, 2016 3:22 pm
by t_klein
Hi,

i've following problem and need some advice.

Sometimes PDFPen ocr'ed the same scanned document in different ways. Ecspecially a date is difficult to match.
So i tried a nested rule to match a date like dd.mm.yyyy and e. g. dd mm.yyyy and so on ...

Here is a sample of my rule.

Code: Select all
If  [all] of the following conditions are met
    [Kind]      [is]        [PDF]
    [Contents]  [contain]   ORDER
    [Contents]  [contain]   Company Name
 If [any] of the following conditions are met for [the current file or folder]
        [Contents]  [contain match]     OrderDate       
        [Contents]  [contain match]     OrderDate 1
        [Contents]  [contain match]     OrderDate 2
        [Contents]  [contain match]     OrderDate 3
        [Contents]  [contain match]     OrderDate 4
        [Contents]  [contain match]     OrderDate 5
    [Contents]  [contain match]     OrderNr

[Rename] with pattern       ([OrderDate]) Order OrderNr.[extension]


It works the patterns have different names - OrderDate and OrderDate 1 to 5. Its not possible to give them the same name!

Can anyone please help me to rename the PDF with the matched one of the matched patterns.

Thanks in advance.
Thomas

Re: Nested Rules and different names for a same pattern

PostPosted: Fri Feb 19, 2016 12:02 pm
by Mr_Noodle
You can re-use custom attributes. Just make sure to drag in the custom attribute from the available list instead of trying to rename a new one to have the same name. Give that a shot and post back here if you are still having problems with it.

Re: Nested Rules and different names for a same pattern

PostPosted: Fri Feb 19, 2016 1:46 pm
by t_klein
Hi Mr_Noodle,

i didn't know that it is so easy. I tried everything but I never re-used a custom attribute.

So i tested it and really, the re-used custom attribute is empty. I added a new attribute and checked it against the first one i created. Really - both have the same name but a different content.

Thank you for your quick reply.

Kind regards!
Thomas

Re: Nested Rules and different names for a same pattern

PostPosted: Fri Feb 19, 2016 2:25 pm
by Mr_Noodle
Do you mean empty in terms of there is no pattern set for it, or empty in terms of the value it captured when you ran the rule? You should be able to create separate patterns for each instance of the attribute. Also, keep in mind the first instance to match is the value it will keep.

Re: Nested Rules and different names for a same pattern

PostPosted: Fri Feb 19, 2016 2:32 pm
by t_klein
@Mr_Noodle

Sorry, but you are right. The patterns are empty and it's true that the value of the first captured rule will be used for further business

Thomas

Re: Nested Rules and different names for a same pattern

PostPosted: Fri Feb 19, 2016 4:09 pm
by Mr_Noodle
Are you still having problems with it or is it all sorted out? If you still need help, post the rule as you now have it or you can email it in if that's easier.