Just starting out with smart rules and scripting … and already encountered a curious bug:
I have a smart rule for renaming pdfs created from screenshots that contain a date. The smart rule action Change Name contains the placeholders Sortable Document Date and Weekday of Document Date.
Applying the rule to pdfs with various dates in the document results in filenames with a correct sortable date and a wrong weekday that is off by one day: e.g. instead of ‘2022-12-06 Tuesday’, it is ‘2022-12-06 Monday’.
Even worse: if the document contains a date of a Sunday, then DEVONthink crashes without changing the name.
Just in case, I tested changing the system setting for First Day of Week from Monday to Sunday, but that does not seem to have an effect on the issue.
Please choose Help > Report Bug while pressing the Alt modifier key and send the result to cgrunenberg - at - devon-technologies.com including an example document/screenshot - thanks!
Why do you have mixed locales for your weekdays, i.e. they’re German at the bottom of your screenshot but English on top? Put differently: It seems that DT is running in an English locale, whereas other software on the same Mac run in a German one.
My system is set to English because most all support information on the Internet is in English and it’s much easier for me if menu commands and such are the same.
I just tried to change DEVONthink’s interface language to German, but couldn’t find an option - maybe it always uses the system language?
Actually, it didn’t even occur to me to expect a German output for the Weekday function . Maybe someone with a German system could test this? I’d rather not change mine.
The example above was a pdf created from a screenshot of a German webpage. This does not seem to be a problem for the scan text action.
I also tested my smart rule with a minimal pdf containing just an English format date and it crashed too.
It does, as does (or should do) every other app on your Mac.
Which seems to indicate that the issue is not related to locale settings.
What operating system are you running?
The most recent - Ventura 13.0.1
My guess is this could be an issue with a zero- vs. one-based array for the names of the days. So, if some code assumes that day=“Sunday”, day=“Monday” and so on, when in fact day=“Sunday”, day=“Monday” etc., while day is undefined - that would explain the day’s name being off by one or crashing when trying to access day
Of course, there shouldn’t be a crash but a graceful exit with an error message …
It’s a little bit more complicated but the next release will fix this.
That’s great to hear! Thank you