Smart Rules and applying them

Notifications would only appear when DEVONthink is not the frontmost application.

1 Like

Please see my post directly above yours :slight_smile:

Ah, thanks @bluefrog.

Thanks @BLUEFROG that explains it ! I was looking for them to appear in DT as the rule is completed !

Youā€™re both welcome. :slight_smile:

A Display Alert action will display in DEVONthink.

Hi there @Blanc Yes all the smart rules in the list are now on import. here is a screenshot

I have changed all the M&S occurrences to Marks and Spencers as attached rule

Iā€™ll try another run of the script.

No it didnā€™t work. I didnā€™t even get pdfā€™s. the conversion rule has 3 next to it because I imported 3 e-mails but no pdfā€™s were produced. :thinking:
Edit
When I look at the log it says I have reimported the emails. I had deleted the emails from the groups and reimported them so maybe thatā€™s causing a problem. I donā€™t have any new receipts !!

Had you emptied the trash? You should be able to reimport as new if the email is deleted from the group and the trash is emptied :slight_smile:

1 Like

No I hadnā€™t emptied the trash ! I have now though and tried again. I got PDFā€™s but not the second part.

Did the rules show that a document matched the criteria (i.e. show a 1 next to the name of the rule)? When looking at the two rules you posted above, I see that the M&S rule contains a ā€œFromā€ condition; whilst the E-Mail will contain a sender, the PDF probably wonā€™t; as such, the criterium should be ā€œContentā€ matches; and as I suggested previously, try both Marks and Spencer and ā€œMarks and Spencerā€; the same for any other rule which contains more than one term in any Content matches condition.

To better bug fix this, letā€™s concentrate on one specific e-mail and rule; if possible, letā€™s test with that one specific mail each time - that should make things more predictable. Remember to delete the mail in DT and empty the trash before each new test.

1 Like

Iā€™ve altered the Marks and Spencer rule to be content matches Marks and Spencer as that always appears at least once in the email.
Yes the rules had 1 in their titles so the pdfā€™s were recognised
Ok, I will testnow just with the Marks and Spencer rule

OK, The .eml file is in trash. I have a pdf in the in box. The marks and Spencer rule has a 1 in its title.

ok; now please try altering the rule so it uses Content matches ā€œMarks and Spencerā€ (so enclosing the term Marks and Spencer in "). Delete the pdf, empty the trash, and import the mail againā€¦ :wink: Weā€™ll get there in the end :smiley:

Added the inverted commas. Just the same pdf created and 1 in the rule title

Ok, thanks. Iā€™ve got an idea, Iā€™ll play with it tomorrow evening and get back to you. Thanks for persevering :slight_smile:

1 Like

Itā€™s many thanks to you for helping me with this, I really appreciate it and just sorry to have caused a bit of a problem ! Please, there is absolutely no rush !

Itā€™s my intention we get to the bottom of this :wink: I need to send myself some e-mails and reenact what you are doing to see what it going on. My basic tests worked, and itā€™s not obvious to me why things arenā€™t working for you. As I said, I have an idea though. I spent last night at a major incident before going on shift this morning, so Iā€™m not going to get round to testing until tomorrow. But test I will!

1 Like

Please donā€™t stress about it there is absolutely no rush. Please enjoy your weekend.
Dorothy

1 Like

Iā€™ve found the problem :slight_smile:; in your first rule (with the script), you have a Move to Trash action; that action is unnecessary, as the script moves the file to trash of its own accord. For whatever reason that extraneous action is inhibiting further rules from running. Please remove that Move to Trash action from the rule.

I have successfully tested with the above rules (the first contains the script posted above, which your rule already contains). You can leave the additional On Demand trigger in the first rule if you want, Iā€™ve tested that too. Also, you might want to add a Mark as Read action in the second rule; if you do so, it needs to go between the Change Name and Move actions.

PS (for anybody passingā€¦): if the second rule moves the record to a group within the same database as the search criterium for that rule, then Exclude Subgroups needs to be selected. @Dorothy you can select Exclude Subgroups in your second rule(s); so long as once the rule has run it no longer displays a 1 next to the rule title you donā€™t need to, though.

PPS note I use a Cancel action at the end of the second rule; if you are not expecting any other rules to run on the record, then I think using a Cancel action is a good idea. Cancel says ā€œdonā€™t run any other rules on this recordā€ - which can be helpful and make things more predictable when playing with new rules down the line. Either way, itā€™s good to be aware of whether further rules can or cannot run after a rule has triggered.

3 Likes

@blanc thank you so much ! You have cracked it ! I took out the move to trash action then added mark as read to the Marks and Spencer rule and tested it with just that one receipt and it worked.
Then I tested it with three different receipts and they were all filed automatically in the correct groups. Fantastic !
Iā€™m not sure Iā€™m understanding about the cancel action. I quite often have two or three receipts from different companies imported at the same time. In that case is it best to leave out the cancel action or have I misunderstood that bit ?