poke through 52000+ lines of code in birch.js
Absolutely – I take your point, and I should have mentioned that all of the scripting interface is attached to the editor
object of TP3.
If anyone did want to get a sense of what is there, before the documentation is released, the thing to search for would be OutlineEditor.prototype
.
The interface may not be fully finalised yet, but it you look at the methods of OutlineEditor
– things like:
.isExpanded()
.isCollapsed()
.setExpanded()
.setCollapsed()
.expandAll()
.collapseAll()
.expandToIndentLevel(n)
...
etc. etc.
(ignoring anything that starts with an underscore (it will be for internal use) you may get some idea of the richness and depth of the scripting interface.
I’m thinking it will be more productive to work in Python and manipulate TaskPaper files directly
Well, that’s possible – everyone’s mileage varies. I think, however, that when the documentation comes out, you may find that it automatically lifts a lot of weight which you would have to shift manually in Python.
(Amongst other things, it immediately gives you a particular array of lines (and all their properties) in exchange for any TP3 search path, including all the axes like descendant
, following-sibling
etc and all the filtering by tags and their values, and by line type).
And, of course, because of web browser competition, JavaScript is very highly optimised. It runs a lot faster than Python and Applescript : - )