I’m trying to write a template such that I can capture a movie title and put it in my existing org-roam file movies.org, under the heading “Watched.” Here’s that template:
You are using an invalid list. From the docstring for org-roam-capture-templates:
(file+olp "path/to/file" ("h1" "h2"))
The file will be created, prescribed an ID. If the file doesn't contain
the outline path (h1, h2), it will be automatically created. The point
will be adjusted to the last element in the OLP.
But I have an even bigger problem now: it wants to rewrite my whole existing movies.org file, instead of just adding something to it. It creates a new buffer with the same name but different contents.
Ah so I figured out what was wrong with the duplicate files—it turns out I had two org files, one called movies.org and one called movies.org with a space at the end. And that was throwing everything off.
You should be able to call a function with using % as a prefix like this: %(org-id-get-create). I think you can put it in in your template (somewhere after your “***”) — can’t test it now but you can read it in the docstring of org-roam-capture-templates (C-h v).
It seems like org-id-get-create expects the buffer to be visiting a file
(error ‘org-id-get’ expects a file-visiting buffer)
This below seems to work for me (lightly tested). I guess you’d need to adjust the function according to the ID you use (e.g. I use a certain date format instead of uuid).