# Smart rule to replace text in name

**URL:** <https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442>\
**Category:** Automation\
**Created:** [May 6, 2020, 5:22am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442 "2020-05-06T05:22:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlohGro](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/flohgro/32/38803_2.png) [@FlohGro](https://discourse.devontechnologies.com/u/FlohGro)\
**Post date:** [May 6, 2020, 5:22am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/1 "2020-05-06T05:22:03Z")

</div>

Hi,  
I’dm importing forwarded E-Mails into DEVONthink automatically with a mail rule.  
Now I’d like to get rid of the “fwd:” / “Fwd:” / “Re:” and so on in the names.  
I found the apple script to replace parts of a title, but I can’t select it in the smart rule action.  
I also would like to just have one rule which will strip all of these prefixes in the name.

Is this somehow possible with the placeholders??

Btw. Is there a way to organize SmartRules and / or hide some of them in the sidebar?

---

<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:** [May 6, 2020, 7:28am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/2 "2020-05-06T07:28:43Z")

</div>

> [@FlohGro](#):
>
> Is this somehow possible with the placeholders??

Not yet but the next release will improve smart rules.

> [@](#):
>
> Btw. Is there a way to organize SmartRules and / or hide some of them in the sidebar?

This is planned for future releases.

---

<div class="post-metadata">

**Author:** ![FlohGro](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/flohgro/32/38803_2.png) [@FlohGro](https://discourse.devontechnologies.com/u/FlohGro)\
**Post date:** [May 6, 2020, 8:24am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/3 "2020-05-06T08:24:21Z")

</div>

Great news thanks!

---

<div class="post-metadata">

**Author:** ![Jk12](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jk12](https://discourse.devontechnologies.com/u/Jk12)\
**Post date:** [May 27, 2021, 12:20am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/4 "2021-05-27T00:20:42Z")

</div>

Was this done? Is it possible to change the name based on left/right/mid of the filename string?

---

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [May 27, 2021, 1:48am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/5 "2021-05-27T01:48:39Z")

</div>

> [@Jk12](#):
>
> Is it possible to change the name based on left/right/mid of the filename string?

You can use a regex for that.

Here’s a Smart Rule by @mhucka that shows how regex can be used:

 ![](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/3/8/38714fb470a69c30d9ebc259fc3ff10ea0ea5007.jpeg)

See the `Scan Name` and `Change Name` actions at the bottom?

In these two posts he explains it

- [post that explains what the Smart Rule does](https://discourse.devontechnologies.com/t/moving-inbox-notes-to-specific-folders-in-my-db/64441/6)
- [post that explains the regex](https://discourse.devontechnologies.com/t/moving-inbox-notes-to-specific-folders-in-my-db/64441/9)
