I'm trying to create a function that will set a tag and a property with current timestamp to an header entry selected in agenda.
This is what I came up with so far, it adds the tag but it does not add the property at all:
(defun my-org-agenda-set-focus-for-task ()
"Add :focus: tag and a PROPERTY with current timestamp to the item selected"
(interactive)
(when (eq major-mode 'org-agenda-mode)
(org-agenda-set-tags "focus" "ON")
(org-set-property "FOCUS" (format-time-string "%Y-%m-%d %H:%M"))))
I also tried to use org-agenda-set-property but it crashes saying that I'm passing to many arguments. How can I make it work?