Question

Is it possible to create an org-capture template that inserts text in a capture file, under a specified heading (same heading every time) but does not create new headlines beyond that? i.e. instead of putting it under * %U, to put the captured text under \n- [ ] instead? I tried to do this but I'm getting errors.

Here is my attempt:

(setq org-capture-templates
  (quote
   (
("l" "Later" entry (file+headline "scratch.org" "later")
 "\n\n\n- [ ] %?\n\n" :prepend t :kill-buffer t)
   )))

Here's what the org file looks like now:

* Notes  
Lorem ipsum dolor sit amet.  

Lorem ipsum dolor sit amet.  
* Later
* Tasks

Here's what it should look like after:

* Notes  
Lorem ipsum dolor sit amet.  

Lorem ipsum dolor sit amet.  
* Later
- [ ] Second capture would go here. 
- [ ] First captured text would go here. 
* Tasks
Was it helpful?

Solution

In org-capture templates, entry creates a new heading. For checkbox items, use checkitem instead.

(setq org-capture-templates
(quote
(
("l" "Later" checkitem (file+headline "scratch.org" "later") " [ ] %?\n\n" :prepend t :kill-buffer t)
 )))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top