Todos and searching for todos

For the last 6 months I’ve used DT more that the last 15+ years combined, and I really like that I’m able to use DT for so many things and I want to see if I can move more stuff into DT.

One thing I use DT for is to keep meeting notes and notes from other things (I use markdown), these are usually done in a “daily note”. The notes are usually in a list format, and I would be able to mark one of this items as “OK, you need to fix this”. I’ve played around with using "- [ ] " but it only works visually if it is a list with only todos, I can’t mix a regular list with todos, but I can understand this if I think about how HTML works.

More importantly, I’m not able to creata a smart group that matches "- [ ] ". If I create a smart group with the rule “Content matches ‘- [ ]’”, I get results that doesn’t contain "- [ ] " so I assume the match isn’t “exactly as written” but something else.

So my questions are:

  • What am I missing in the search rule?

  • Is there a better way to handle todos in notes? I don’t want to switch to another app while I take notes, I just want to quickly note this as something I need to do and carry on. Also it’s not always I have the chance to go through the notes the same day and sometimes these “todo” are in files other than the daily notes.

Is a “regular list” a numbered one?

Only alphanumeric characters are indexed, therefore searching for these characters is not possible.

“regular list” is a bullet list, or “-” in Markdown speak

Ahhh, then I understand why search doesn’t work - well, I figure out some other marker ( ‘FIXME’ is currently high on the list of replacements :yum:)

The next release should fix this issue in case of mixed lists, could you please post the snippet that doesn’t work in your case? Then I could check this, thank you.

Interesting, when I do new test document, the checkbox appears but in the document I was writing it doesn’t. I removed the actual content to get the text below but checkbox for item 10 doesn’t show up for me.

# 2021-06-07 Måndag

## Planer s

-   one
    -   two
    -   three
    -   four
    -   five
    -   six
    -   seven
    -   eight

-   nine
- [ ]   ten
-   eleven

As you found out the DT search ignores non alpha-numeric characters
Unlike Applescript where these todo items can be identified

I would process the notes using a script
which creates individual task notes (processed in my task management workflow)

1 Like

Hmmm, interesting idea …

Have you documented this somewhere? I tried to look at your user page but didn’t see anything … except a reference how you build a ToC.

Sorry for the delay in answering, things happened. This was how I planned to mark up things, but I’m open for other ways to do it (the note structure is something I already use )

# 09:07 Some notes

Vestibulum torquent cursus semper mi turpis nibh gravida mauris penatibus, nisl egestas sociosqu commodo fermentum in magna posuere litora, neque aliquam diam quisque suspendisse molestie inceptos sollicitudin pellentesque, elit pharetra ut eget senectus nulla erat fames. Libero primis taciti tincidunt tempus malesuada egestas sociosqu mi odio himenaeos, integer mattis ultricies nullam elementum ridiculus blandit magnis commodo nec

- Cras cubilia eu auctor massa neque primis malesuada feugiat, 
- proin tincidunt facilisis euismod posuere at suspendisse natoque, 
- [ ] Somthing I should do 
- dignissim egestas elit magna magnis phasellus aliquam integer viverra, 
- libero nullam purus morbi finibus interdum duis. 
- [ ] Something else I should do 

Arcu dictum nec fermentum vivamus platea eleifend ipsum pellentesque, morbi nisi donec vulputate neque facilisi fames taciti, finibus varius curabitur ut maecenas natoque per tempus, quam quis porttitor semper id hac consequat. 

- [ ] Some regular text that I need to remember Donec luctus vestibulum blandit vel suspendisse class leo ante pellentesque, tellus fermentum curabitur porta mattis duis sodales consectetur purus, 

facilisis vitae quam maximus tincidunt nam porttitor mollis, iaculis ut nullam neque amet nascetur platea dignissim. Sagittis ut hendrerit sed class dolor mus neque senectus imperdiet laoreet,

# 09:12 Some other notes

yada, yada, yada, ...

Your Sample Note shows a ToDo delimiter of "- "
There’s no terminator, so I used the first paragraph
We want the Sample Note distilled down to

Somthing I should do
Something else I should do
Some regular text that I need to remember Donec luctus vestibulum blandit vel suspendisse class leo ante pellentesque, tellus fermentum curabitur porta mattis duis sodales consectetur purus,

For the search, I came up with this rough scipt

tell application id "DNtp"
	set selectedNotes to get selection
	repeat with theNote in selectedNotes
		set theContent to plain text of theNote
		set theToDos to my ParseText(theContent, "- [ ] ")
		repeat with i from 2 to count of theToDos
			set theToDo to item 1 of paragraphs of item i of theToDos
			my ToDoProcess(theToDo)
		end repeat
	end repeat
end tell

on ToDoProcess(theToDo)
	display dialog theToDo
end ToDoProcess

on ParseText(theContent, theDelimiter)
	set savedDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to theDelimiter
	set theContentParsed to every text item of theContent
	set AppleScript's text item delimiters to savedDelimiters
	return theContentParsed
end ParseText
2 Likes

Thank you