Hi,
I try to automate clock in and clock out operations.
I have put something like this together:
(defun rst/clock-in-out ()
(interactive)
(when org-agenda-info
;; (org-agenda-switch-to))
(org-agenda-goto))
(show-subtree)
(org-clock-in)
(org-clock-out)
(unless (org-at-heading-p) (outline-previous-heading))
(search-forward CLOCK: )
(forward-char 19)
(org-shiftcontrolup)
(org-shiftdown))
(define-key org-agenda-mode-map (kbd f10) 'rst/clock-in-out)
(define-key org-mode-map (kbd f10) 'rst/clock-in-out)
Being in any subtree it works flawlessly.
What I now want: Do the same when being on an agenda item and pressing F10.
I want to switch to the org file and start what already works.
What I have does not work, neither (org-agenda-switch-to) nor (org-agenda-goto)
Please help. Where could I find information/docs for something like
How to determine when I am in agenda view?
Thanks,
Rainer