After reading some more<https://groups.google.com/forum/?fromgroups=#!searchin/leo-editor/gnx/leo-editor/4P2MpEWaX0g/i9F32IWtO-gJ>, is gnx what I was talking about? Static-inmutable node references?? If so, please include that information within the positions part<http://leoeditor.com/scripting.html#import-objects>of the documentation! I have been needing it so much!!
If so, Matt, then gnx of the nodes is the information you would need from the file, then, your minibuffer command should: Define this hook <http://leoeditor.com/scripting.html#event-handlers>: ‘open2’ after opening any filec,old_c,new_c,fileName (note 4) 1. ‘open1’ and ‘open2’ hooks: These are called with a keywords dict containing the following entries: - c: The commander of the newly opened window. - old_c: The commander of the previously open window. - new_c: (deprecated: use ‘c’ instead) The commander of the newly opened window. - fileName: The name of the file being opened. You can use old_c.p and c.p to get the current position in the old and new windows. Leo calls the ‘open1’ and ‘open2’ hooks only if the file is not already open. Leo will also call the ‘open1’ and ‘open2’ hooks if: a) a file is opened using the Recent Files menu and b) the file is not already open. Then open the leo file,and then have it read a global list which has the nodes you want to execute. g.app.db['MyGnxToExecute']=(gnx1,gnx2,etc) Then if list exists, read that list and execute those, but still I dont know how to translate from gnx to node position<https://groups.google.com/forum/?fromgroups=#!topic/leo-editor/SLiSDPQGzqo>hehe On Wednesday, June 12, 2013 10:53:21 AM UTC+2, Fidel Pérez wrote: > > Anyway the more I think about it the more I dont realy understand how come > we canot refer nodes in a static way, so Im asking again in case it already > exists: > > Are vNodes static? > I think vNodes should have associated reference number each, which would > stay the same until its deleted (even if we change the outline or > open/close the document). > This way we could easily refer vNodes from outside an outcome, and easier > from within the current outcome. > The way would be: > New vNode -> New refference number, different to any existing one in that > outline > > Is there such a thing as a stable ID number per vNode? > > > On Wednesday, June 12, 2013 10:05:08 AM UTC+2, Fidel Pérez wrote: >> >> My way of doing this would be to first add a global Leo variable to >> specify the LeoFile I want to open, then the node name I want to execute >> (actually It would be cool if we could also specify the tags of the node, >> just in case there are several with same name, etc). >> Then make a open-the-workbook hook on the "workbook.leo" file which will >> execute the pointed node if the variables pointing it exists in the >> database (if they dont, you are just using the "workbook.leo" with other >> purpose than executing that script) >> >> Anyway, the general purpose of all my work in leo is towards automation, >> so I will provide better solutions for this in the _hopefully_ near future. >> HTH ^^ >> >> >> On Wednesday, June 12, 2013 9:55:02 AM UTC+2, Matt Wilkie wrote: >>> >>> Is it possible to have leo execute the code in a specific node or tree >>> of nodes from the command line and then exit? e.g. >>> >>> leo --script=workbook.leo--scripts--cool-thing-1 >>> >>> where Workbook.leo looks like: >>> >>> workbook.leo: >>> \-- Docs >>> \-- Research >>> \-- Scripts >>> \-- cool thing 1 >>> \-- cool thing 2 >>> >>> and the result of the command line would be the same as interactively >>> opening workbook.leo, navigating to 'cool thing 1' node and pressing >>> [Ctrl-B]? >>> >> -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
