stevencohn/OneMore

Sort Notebook Sections by Date Created

Closed this issue · 3 comments

Problem to Solve

For running, chronological daily/weekly notes (say where one section = 1 unit of time), there does not seem to be an easy way to sort sections by date created. The only solution on Microsoft docs seems to be manually dragging sections notes around within the notebook UI or file explorer - which becomes when attempting to organize for years worth of notes.

New Feature/Solution

OneMore's sort functionality for includes sorting by Name and Date Modified. If it's possible and useful to others, adding sort functionality for Date Created would be awesome!

image

Apologies if there is a duplicate request out there. And thanks for building/maintaining a very useful tool!

--Flannan

OneNote does not retain the creation date of sections. That's why that option is grayed out.

Thank you for the quick response, @stevencohn! Makes sense then re: inability to filter on creation data.

I'll probably make a one-off script for my use case based on each file's ctime (creation time for path on Windows OS). This code excerpt is in Python, but wonder if File.GetCreationTime() could be used in C#

import os.path
import datetime as dt

createDate = os.path.getctime('10-18.one')
createDate_dt = dt.datetime.fromtimestamp(createDate)
print(createDate_dt)

2021-10-17 16:14:05.869137

Cheers,
Flannan

That would work I think if you're not storing your notebooks on OneDrive. You could also use OneMore's plugin capability. See bottom of this page. Basically, it hands you XML, you muck around with it, and then give it back to be saved on your behalf. Be sure to set the Target to current notebook

Another way to use the plugin is to examine the pages within each section. Pages do have creationTime and you could infer relative creation time of each section by discovering the oldest page in each section. I thought of that when you first posted this ticket but I'd have to think more about it to make sure there are no gotchas.

Another alternative is to prefix each section name with a date stamp yyyy-mm-dd making it sortable by name.