Smart group/rule by date in filename?

I would like to have a smart rule setup that takes an action based on whether the name of a file starts with or contains a date (YYYY-MM-DD) that is less than or equal to today plus other parameters.

So, for example, if the label is “to do” and the file date begins with YYYY-MM-DD, the label could be changed to “urgent”.

Is this possible?

On a semi-related note, is it possible to set “Due Date” or “Reminder” based on Scan Name … Date?

At a first glance I would say that would require scripting. With scripting it is certainly possible, yes.

I appreciate this may not apply in your case but I just wanted to flag—in case it becomes relevant—some difficultites I’ve been having with Scan Name → Date in version 3.8. I’m not yet convinced it’s working as it should.


Thanks. If it is working enough*, I might be able to use a similar smart rule to yours to achieve part of what I am looking for:
groups/smart groups for actionable items based on type of action, urgency/importance, etc., ideally in a way that syncs to/shows up in DTTG.

(*) all I need is a recognition of the date YYYY-MM-DD

All I can say at present is that for me, using DT 3.8 under macOS 11.6, I get inconsistent results (although I’m not aware this has yet been reproduced by others). For example:

  • Create a new markdown file named Monday 11 October (you probably need to use the date format appropriate for your regional settings in macOS)
  • Add the following text to the file Custom: Monday 11 October 2021 (again following the date format in your regional settings)
  • When I run a smart rule on the record using Scan Text -> Date -> Custom: * the date is found and I can use Document date in a subsequent action to do something with it (for example, add it to custom metadata)
  • However, if I use Scan Name -> Date -> * in the smart rule the date is not found

It’s slightly more peculiar than that. Once the date is found under the first smart rule it also seems to be found when I apply the second rule to the same document—but not for new documents in a similar format.


Hm… I discovered custom metadata dates cannot be empty, so I have to figure something else out.