Smart rules 'within the last'—only accepts whole days?

I want a smart rule to act on files that were modified ≥ 5 minutes in the past. It seems (if I am not mistaken) that this isn’t possible via smart rules alone. before requires an exact date, and not within the last can be specified only in the unit of days. I tried inputting 0.0034 days (roughly 5 minutes) but the field seems to only accept integers.

Is there any way to do this efficiently? It could be done with running a script to collect any records that match the criteria but my assumption is that a smart rule would be more efficient, given that it’d be running very regularly.

That’s correct as we didn’t assume that anyone would try to calculate such precise intervals.

Currently scripting would be the only possibility. What’s the job of this smart rule actually?

To be honest, the use case is a bit of a hack. I have a workflow that goes as follows:

  • Deconsolidate a PDF file to iAnnotate’s iCloud folder (iAnnotate can only access its own iCloud folder).
  • When finished editing (on iOS), run a Shortcuts action to update metadata (tags, rating, etc.).
  • After syncing, a smart rule tells DEVONthink (macOS) to reconsolidate the file.

The problem is that I have to be careful to check if iCloud has finished downloading the modified PDF. If it hasn’t then changes will be lost. So, I’m trying to add a 5-minute ‘buffer’ between updating metadata and consolidating the file itself.

There are several ways to do this, I am just trying to figure out what way is most efficient (and fool-proof). It could be done just with an AppleScript delay 300 command but that can be interrupted, e.g. if DEVONthink needs to close. It could also be done with a script that checks for pending changes before/after sync, or something like that. In the past, I did this with Hazel watching the iAnnotate iCloud folder for a particular tag and then triggering the necessary scripts.

I may be overthinking it but I like to automate!

The makers of iAnnotate could solve this for me by updating their software to escape the sandboxing. In case you are wondering why I don’t just use DTTG to do my PDF annotation, iAnnotate has a number of features that (despite being in development limbo for years) make it still the best PDF reading solution out there (imo). It has a fully customisable sidebar, which allows me to use the colour coding scheme for my research that I’ve now been using for more than 10 years. In DTTG it just takes too many taps to switch between colours. Second, it has ‘set mark’ and ‘return to mark’ features, which are extremely useful for reading long documents, especially those with footnotes/endnotes. Third, it can lock the displayed page width, meaning that you can hide wide margins and have the page scroll only vertically. That may seem like a small thing but when reading a 300 page book on a screen it makes a difference.

I know that DTTG uses a third party PDF editing framework, so there’s not much use making feature requests directly. Nevertheless, fwiw!

The next release of DEVONthink should make the handling of indexed iCloud files (especially those not yet locally available) more reliable. Not sure if this will fix your issue but it’s at least possible.

1 Like