# How to make a smart rule to rename, convert & move without leaving original behind?

**URL:** <https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925>\
**Category:** DEVONthink\
**Created:** [February 26, 2020, 3:17pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925 "2020-02-26T15:17:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![avatar](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/avatar/32/18022_2.png) [@avatar](https://discourse.devontechnologies.com/u/avatar)\
**Post date:** [February 26, 2020, 3:17pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/1 "2020-02-26T15:17:00Z")

</div>

How can I set up a smart rule that, on import, converts a .txt file that begins with the three characters in sequence “4x-” to .rtf, renames it to the Long Creation Date, and moves that .rtf to a different group in the inbox, _without_ leaving the original .txt file behind (or deleting the originally imported .txt file)?

I always seem to have to leave the original .txt file in the trash, or in some other ad hoc group that it can’t be deleted from immediately.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [February 26, 2020, 3:36pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/2 "2020-02-26T15:36:10Z")

</div>

This rule renames the file & deletes the original:

 ![Screenshot 2020-02-26 at 16.35.11](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/d/de856beae5ffb7e734574c97da4d2269b652e4a9.png)

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [February 26, 2020, 3:36pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/3 "2020-02-26T15:36:56Z")

</div>

Please note that the last action is applied to the original. If you would use _Convert & Continue_, then the last action would delete the converted text.

---

<div class="post-metadata">

**Author:** ![avatar](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/avatar/32/18022_2.png) [@avatar](https://discourse.devontechnologies.com/u/avatar)\
**Post date:** [February 26, 2020, 4:08pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/4 "2020-02-26T16:08:09Z")

</div>

That’s not quite what I meant.

For instance, this rule sends the plain text version to the trash, but leaves the converted .rtf in the Inbox - it doesn’t move it to the “special” group (which is a group inside the Inbox):

 ![not-working](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/6/63df7e71c81e8cb2ebef1de7098f53ba5ded5903.png)

---

<div class="post-metadata">

**Author:** ![avatar](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/avatar/32/18022_2.png) [@avatar](https://discourse.devontechnologies.com/u/avatar)\
**Post date:** [February 26, 2020, 4:28pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/5 "2020-02-26T16:28:37Z")

</div>

OK I find that this works, but is there any way of also deleting the .txt file left in the trash?

 ![works-almost](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/c/cc444fae6f593f5f97587f59851aee3956f53913.png)

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [February 26, 2020, 7:42pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/6 "2020-02-26T19:42:20Z")

</div>

You’re still somewhat misunderstanding the flow of the input in smart rules. Once the input has changed, e.g., when using a **Convert & Continue** action, it can’t be returned to the original input _(at least at this time, it can’t)_.

Look at this smart rule and notice the input never changes…

 ![Screen Shot 2020-02-26 at 02.31.45 PM](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/2X/9/96dd6247b94e75dcdfe6b6c94927731b27e46b11.png)

1. Move the file to the Special group
2. Change the file’s name
3. Convert the file to a rich text file, yielding another file in the group with the new name
4. Delete the file

---

<div class="post-metadata">

**Author:** ![avatar](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/avatar/32/18022_2.png) [@avatar](https://discourse.devontechnologies.com/u/avatar)\
**Post date:** [February 26, 2020, 9:58pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/7 "2020-02-26T21:58:55Z")

</div>

I see it now. Thanks for clarifying that for me. I was kind of stuck on the “move to trash” part and missed the “delete”.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [February 27, 2020, 3:00am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/8 "2020-02-27T03:00:22Z")

</div>

No problem.

---

<div class="post-metadata">

**Author:** ![Thilo](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thilo/32/22717_2.png) [@Thilo](https://discourse.devontechnologies.com/u/Thilo)\
**Post date:** [December 13, 2021, 5:11pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/9 "2021-12-13T17:11:56Z")

</div>

Hi,  
this is an elder discussion, but I think my question matches the subject…  
Trying to create a rule, that looks for PDF in the Income Folder, executes OCR, than looks for document Date and suggested name.  
If I want to delete the original doc, it always deletes the new copy with the new name.  
If I move it to another folder in the database, the rule doesn´t do anything…  
I´m sure I´m just a little mistaken, so thanks for any help!

![image](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/e/0/e07fe22684246c80e45cb804237c808f38ea3d3c.png)

Regards Thilo

---

<div class="post-metadata">

**Author:** ![Blanc](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/blanc/32/8008_2.png) [@Blanc](https://discourse.devontechnologies.com/u/Blanc)\
**Post date:** [December 13, 2021, 6:05pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/10 "2021-12-13T18:05:46Z")

</div>

So, several things to say here:

- if you use the _Convert & Continue_ action instead of the _OCR_ action, and move your _Move to Trash_ action to the first position then all will work as intended. Convert & Continue means that all subsequent actions are performed on the new document. It may seem counter-intuitive to move the original file to trash _first_, but that’s the only way to act on the original - namely prior to the _Convert & Continue_ action. Obviously your new file will be created in Trash, but that is of no consequence as you are already using a _Move_ action.

- alternatively you can forgo the _Move to Trash_ action when using the _OCR_ action if you choose the appropriate setting in the preferences (see OCR/Original Document: Move to Trash); AFAIK the following actions will then pertain to the OCR’d file.

- currently your rule OCRs documents which already contain text; that can degrade document quality. You might want to add a second condition, namely _Word Count is 0_. That way only PDFs without a text layer will be treated by the rule. You could then set up a second rule with a _Kind is PDF_, _Word Count is not 0_ condition which only changes the name and moves the file, but does not OCR ist.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [December 13, 2021, 7:12pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/11 "2021-12-13T19:12:08Z")

</div>

> [@Blanc](#):
>
> alternatively you can forgo the _Move to Trash_ action when using the _OCR_ action if you choose the appropriate setting in the preferences (see OCR/Original Document: Move to Trash); AFAIK the following actions will then pertain to the OCR’d file.

Or just use _OCR \> Apply_ and remove the _Move to Trash_ action.

---

<div class="post-metadata">

**Author:** ![Blanc](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/blanc/32/8008_2.png) [@Blanc](https://discourse.devontechnologies.com/u/Blanc)\
**Post date:** [December 13, 2021, 7:40pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/12 "2021-12-13T19:40:09Z")

</div>

> [@cgrunenberg](#):
>
> Or just use _OCR \> Apply_ and remove the _Move to Trash_ action.

Isn’t that what I said? 😃 With more words, of course - but you folk should be used to that by now 😃 Criss, is the behaviour of OCR \> Apply not dependent on the setting I mentioned? If it is, then the advantage of my first approach is that it would work for everybody, regardless of settings in the preferences (which I find preferable in a forum like this). If, of course, OCR \> Apply is independent of preferences then I just wrote a long and pointless post 😃

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [December 13, 2021, 8:15pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/13 "2021-12-13T20:15:30Z")

</div>

> [@Blanc](#):
>
> Criss, is the behaviour of OCR \> Apply not dependent on the setting I mentioned?

_OCR \> Apply_ does not create a new record, therefore the setting doesn’t matter as nothing has to be moved to the trash.

---

<div class="post-metadata">

**Author:** ![Thilo](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thilo/32/22717_2.png) [@Thilo](https://discourse.devontechnologies.com/u/Thilo)\
**Post date:** [December 14, 2021, 9:57am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/14 "2021-12-14T09:57:09Z")

</div>

Hey,  
thank you very much, both solutions work fine! Just starting with Devonthink, what a great tool!

Is there a way to check within in rule if OCR has already been performed? But I think there has to be an “if” condition? If no → perform, if yes → don´t ?  
THX  
Thilo

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [December 14, 2021, 10:03am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/15 "2021-12-14T10:03:16Z")

</div>

> [@Thilo](#):
>
> rule if OCR has already been performed

You can check for “words greater 0”

---

<div class="post-metadata">

**Author:** ![Thilo](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thilo/32/22717_2.png) [@Thilo](https://discourse.devontechnologies.com/u/Thilo)\
**Post date:** [December 14, 2021, 11:07am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/16 "2021-12-14T11:07:34Z")

</div>

But will the rule continue the following steps (rename, move) if “word not greater 0”

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [December 14, 2021, 11:17am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/17 "2021-12-14T11:17:14Z")

</div>

That’s the idea.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [December 14, 2021, 11:18am UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/18 "2021-12-14T11:18:12Z")

</div>

> [@Thilo](#):
>
> But will the rule continue the following steps (rename, move) if “word not greater 0”

Do you only want to rename the items after successful OCR? In that case I would suggest to use two rules:

 ![Screenshot 2021-12-14 at 12.15.50](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/c/e/ceb6795729b56541bd2b559162d47864188244e4.jpeg)  
 ![Screenshot 2021-12-14 at 12.14.32](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/f/c/fcd6dff0a70879707f43b9dbb0483ff2ebedd3af.jpeg)

The first one performs OCR on not yet searchable PDF documents and then applies the second rule which checks the word count and processes only searchable PDF documents containing text (e.g. after successful OCR).

---

<div class="post-metadata">

**Author:** ![Thilo](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/thilo/32/22717_2.png) [@Thilo](https://discourse.devontechnologies.com/u/Thilo)\
**Post date:** [December 14, 2021, 12:15pm UTC](https://discourse.devontechnologies.com/t/how-to-make-a-smart-rule-to-rename-convert-move-without-leaving-original-behind/53925/19 "2021-12-14T12:15:40Z")

</div>

Thank you, with two rules it works fine. So I move from Inbox-unchecked to Inbox OCR to Inbox renamed, that helps me at my actual knowledge level (0,0) to verify that the rules have been executed.

General remark: this is a very kind and helpful forum, wherever/whatever I read, thank you for that!  
Have a nice christmas-time  
Thilo
