How to substitute placeholders when creating new document?

I’m trying to automate creating OmniOutliner documents from templates. I want to insert content into newly created OmniOutliner documents using placeholders; e.g., a placeholder might be called {{ summary }}, and when creating a new document, I would have a script first create a blank document from a template and then substitute {{ summary }} with actual text.

Is there a way to achieve this in OmniOutliner, perhaps using JXA? The placeholder syntax doesn’t matter (I can write code to target anything), and I can write in JavaScript or AppleScript (or other languages if needed). Some pointers for how to do this would be most welcome.

Search and replace?

I guess maybe what you mean is the use of find and replace as discussed on the page at This could be done. I was hoping for something a bit higher level, but if nothing else is available, yeah, I could code something using this.

What do you exactly need to accomplish what you want ? Do you need access to some specific OO object or method ?