On Fri, Jun 3, 2016 at 9:45 PM, Conor White-Sullivan <
[email protected]> wrote:
[...]

> Script 1 : Creating Children of current based on selected text
>
> Goal:   I'd like to
>
> 1.  get the value of the text that is currently selected
>
> 2.  create a new node, which has that text as both its headline and body
>       It was unclear from the tutorial how to just create a new node with
> any arbitrary content
>
> 3.   set that node be a child of the currently selected node
>       requires:  getting the position of the current node
>

Have you seen the menu pick Edit->Edit Body->Extract? It uses the first
selected line for the headline of the child and the remaining selected
lines as the body. You could track down that code and learn from it.


>
> Bonus:
>
> 1.  Trigger a little popup that lets me put in the value of what I'd like
> to name this new child
>
> 2.   remove the selected text and replace it with the value << 'whatever I
> named the new child node in the prompt' >>
>

For #2, there is a menu pick Edit->Edit Body->Extract Names. If you have
 <<whatever title>> as the first line of the selected text, then it will
use that as the title and also leave that line in the original body. The
child will have <<whatever title>> with the other lines of the selection as
the body.

Brian

-- 
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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to