Hey I have a question regarding creating a smart rule that is using a placeholder und scan text.
If I understand correctly with the scan text then typing in a string in my case the word “Abrechnung” and then the * Wildcard the text after the string will be copied to the string which I can use later.
BUT how can I tell devonthink how much words are being saved into the string? If I do it like in the screenshot the rest of the document after the string is being copied to the placeholder.
You can’t define the number of words. If this word occurs on a separate line, i.e., not in a paragraph, press Option-Return after the wildcard.
*
means “everything”, so this result is not surprising. You might want to try a regular expression (select “Regular Expression” instead of “String” in the “Scan text” action). Something like this
Abrechnung ((?:\w+\s+){2}\w+)
for three words following “Abrechnung”. Explanation:
- Two occurences
{2}
of a non capturing group(?:…)
containing at least one word character\w+
followed by at least one space\s+
. - followed at least one word character
\w+
- And the whole included in a capturing group
(...)
In your replacement string “Change name” use \1
for these three words.
1 Like