Moving Inbox Notes to specific folders in my DB

In this particular case:

  • the expression .* means “match zero or more characters of any kind” (in other words, match anything/everything)
  • parentheses in the search expression means “store the results of the pattern inside the parentheses”, which in this example, is .* So, the expression (.*) means “match zero or more characters and store the results”.
  • the expression @self(.*) means “match the sequence of characters that begins with @self followed by zero or more characters and store the matched characters after the @self part”
  • the expression \1 means “substitute the first parenthesized match”, so in other words, the results of whatever matched .*

Basically, the two things work together to do the following:

  • look for @self in the name and store what comes it
  • replace the name with the stuff that came after it

Example: @self this is my note becomes this is my note.

As to the date part of the rule, what’s happening is not obvious. When DEVONthink executes the actions in the smart rule, it does them in the order listed in the rule. When it gets to the line involving the date, by that time, it has already changed the name of the note to this is my note. The value of the current name of the note is accessible using the placeholder Name. So, the line involving the date ends up replacing the current name (which by that time has been changed as just described) with a new name that consists of the date followed by that current name.

Example: this is my note becomes 2021-05-12 this is my note.

Important: to insert the placeholder Name, control-click your mouse in the field of the dialog box and look for Insert Placeholder in the pop-up contextual menu presented by DEVONthink. (This is the only way to insert placeholders – you can’t type the literal word Name or do anything like that.)

Some information about regular expressions can be found in DEVONthink’s user manual, and there are many resources on the web for learning the syntax.

3 Likes