I figured out how to get entries I want using org-agenda-get-day-entries
but that only returns the headline and its properties for each entry. Is there any way to access the LOGBOOK
of the corresponding entry and in particular any notes stored there? I'd like to get the date each note was made as well so I can filter them.
The documentation on the elements API isn't great and I'm not sure I can even use it given a list of headlines.
You can parse the drawer at point with org-element-property-drawer-parser
:
(defun org-get-logbook-notes ()
(save-excursion
(unless (org-at-heading-p)
(outline-previous-heading))
(when (re-search-forward ":LOGBOOK:" (save-excursion
(outline-next-heading)
(point))
t)
(let* ((elt (org-element-property-drawer-parser nil))
(beg (org-element-property :contents-begin elt))
(end (org-element-property :contents-end elt)))
(buffer-substring-no-properties beg end)))))