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’.
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.
Exactly.
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[0]=“Sunday”, day[1]=“Monday” and so on, when in fact day[1]=“Sunday”, day[2]=“Monday” etc., while day[0] is undefined - that would explain the day’s name being off by one or crashing when trying to access day[0]
Of course, there shouldn’t be a crash but a graceful exit with an error message …