This newly public API seems very promising – more than I had hoped for
Outline.getOutlines() returns list of all open outlines. outline.getPath() return the file path associated with outline.
A couple of questions about best practice:
Moving items from one outline to another ? Am I right in thinking that we should create fresh copies of the items in the first outline by stringifying and then destringifying them with serialize and deserialize ? (I notice that there’s an assert which checks that children are in the same outline as their parents, so trying a direct inter-outline move is presumably not the right route).
Timing ? If a script has to open a second .taskpaper file, rather than finding an already open document, I guess it will need to make sure that outline building is complete before moving on to reading and mutation of the second outline. Do you have any thoughts or advice on how one might sensibly do that ?