I’d like to make weekend days in Captain’s Log stand out from weekdays by using red for the color of the note name.
Reading this previous thread, I had the impression I could set $Color="red", but if I try to show $Color in Displayed Attributes, it doesn’t come up in the list. This is what I’m trying in the prototype Month edict:
P.S. I’m hoping that .contains is case sensitive, otherwise Wednesday and Thursday will be the color of my face. ChatGPT tells me I could use this regex to get Saturday or Sunday because they’re the only days that begin with “S”
\bS\w*\b
But I’m hoping for the simple case first.
It also just occurs to me that I’m going to need an “else” statement in there, but please help me out with the color first. (Think I fixed that. Also, this color thing is addressed in aTbRef, but it’s not working for me.)
Color is an attribute, and can indeed be added to the Displayed Attributes list. Try it in a new document, just to check.
Is a rule, edict, or OnVisit action setting the Displayed Attributes? If so, that could be changing the displayed attributes after you set them.
You only need $MyDate.format(“W”), which gives you the weekday as a string.
Another test for Sunday would be MyDate.weekday==7. This is slightly more robust, because an Italian user would see that $MyDate.format("W") was Domenica, which doesn’t start with S.
As you have seen — i saw the edit as I was typing this! — you had omitted the {…braces…} surrounding the if clause.
Do you want to turn this note red? Or the newly-created note? If so, you’d want something like:
@eastgate, I was just going to take two screenshots to illustrate what I was seeing, that “Color” did not appear. As soon as I took the screenshot, I saw it. Amazing. Kept looking and looking and wondering what the heck was going on. Gotta get my eyes examined.
I’m using the Long form because I’m including the date in the name of the note. “Friday, March 14, 2025” It would be open in its own tab. Won’t confuse one Friday with another.
Nor should you expect too! Why? Because spell-checking/auto-complete matching, IIRC, works off three or more characters. So, type ‘c’ and get no match but type ‘col’ and ‘Color’ shows as a match. Why so? Starting at >=3 characters massively reduces the possible number of matches. It’s a pragmatic choice to keep things responsive. Some apps start matching of 3, some a higher number. IIRC, the latter is more likely in mobile phone context (think: less powerful CPU).
This also explains why apps and OS sometimes mark (with red dotted underline) a word as incorrect but offer no correction. More often than not, it is because the error is in the first few letters. It’s not a dictionary exact match nor do the first three characters stem a dictionary match.