Re: Simple Scripting Question

2015-07-31 Thread Tim Fuller
Thanks again.  Super impressed with the community here. 

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread 'Terry Brown' via leo-editor
On Fri, 31 Jul 2015 10:53:29 -0700 (PDT)
Tim Fuller  wrote:

> Thanks everybody, I got it working.  Starting to wrap my head around
> how all this works.  I appreciate all the help.

Good.  Although working out how to code these things yourself is far
more valuable than using plugins :-) I'll just point out that the
quick_move plugin and make transient or permanent buttons which copy /
clone / move the current node to designated places.

Cheers -Terry

> On Friday, July 31, 2015 at 10:04:36 AM UTC-4, Tim Fuller wrote:
> >
> > Hello All,
> >
> > I've recently discovered Leo and really loving it.  I am trying to
> > get into the scripting but I'm having trouble doing a simple
> > operation.  Could someone please help me out or point me to the
> > documentation that would lead to the answer?
> >
> > I'm wanting to write a simple script that would take the
> > highlighted node and clone it to an action item list.  
> >
> > So, I'm wanting to clone a node as a child to ActionItems.  I've
> > gotten as far as tmpNode = c.p.clone()  And tmpNode.paste() works
> > exactly as expected.  I just can't figure out how to dictate where
> > to paste it.
> >
> > Thanks
> >
> 

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread Tim Fuller
Thanks everybody, I got it working.  Starting to wrap my head around how 
all this works.  I appreciate all the help.

On Friday, July 31, 2015 at 10:04:36 AM UTC-4, Tim Fuller wrote:
>
> Hello All,
>
> I've recently discovered Leo and really loving it.  I am trying to get 
> into the scripting but I'm having trouble doing a simple operation.  Could 
> someone please help me out or point me to the documentation that would lead 
> to the answer?
>
> I'm wanting to write a simple script that would take the highlighted node 
> and clone it to an action item list.  
>
> So, I'm wanting to clone a node as a child to ActionItems.  I've gotten as 
> far as tmpNode = c.p.clone()  And tmpNode.paste() works exactly as 
> expected.  I just can't figure out how to dictate where to paste it.
>
> Thanks
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread 'Terry Brown' via leo-editor
On Fri, 31 Jul 2015 09:01:15 -0700 (PDT)
Tim Fuller  wrote:

> p.moveToLastChildOf(ActionItems)

p.moveToLastChildOf(g.findNodeAnywhere(c, 'ActionItems'))

is probably what you want.  'ActionItems' is a str(ing) literal, whereas 
ActionItems is an undefined variable.

Cheers -Terry

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread Jacob Peck

Try this:


p = c.p.clone()
dest = g.findNodeAnywhere(c,'ActionItems')
p.moveToLastChildOf(dest)
c.redraw()
---

moveToLastChildOf is expecting a position, not a name. :)

Hope this helps,
-->Jake

On 7/31/2015 12:01 PM, Tim Fuller wrote:
Thank you very much for the quick reply.  I'm feeling quite dumb right 
now as I'm still unable to get this to work.  I have the following 
script:


|

p =c.p.clone()


p.moveToLastChildOf(ActionItems)


c.redraw()

|

But it only pastes the clone directly underneath the current.  I get 
an error in the log stating.


|
exception executing script
NameError: name 'ActionItems' is not defined
|

Can I not call a Node directly by it's name?  Or have I done something 
else incorrectly?


Thank you


On Friday, July 31, 2015 at 10:19:41 AM UTC-4, Edward K. Ream wrote:


On Friday, July 31, 2015 at 9:04:36 AM UTC-5, Tim Fuller wrote:


I am trying to get into the scripting but I'm having trouble
doing a simple operation.  Could someone please help me out or
point me to the documentation that would lead to the answer?


http://leoeditor.com/cheatsheet.html#scripting


EKR

--
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 leo-editor+unsubscr...@googlegroups.com 
.
To post to this group, send email to leo-editor@googlegroups.com 
.

Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


--
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread Tim Fuller
Thank you very much for the quick reply.  I'm feeling quite dumb right now 
as I'm still unable to get this to work.  I have the following script:


p = c.p.clone()

p.moveToLastChildOf(ActionItems)

c.redraw()

But it only pastes the clone directly underneath the current.  I get an 
error in the log stating.  

exception executing script
NameError: name 'ActionItems' is not defined

Can I not call a Node directly by it's name?  Or have I done something else 
incorrectly?

Thank you


On Friday, July 31, 2015 at 10:19:41 AM UTC-4, Edward K. Ream wrote:
>
>
> On Friday, July 31, 2015 at 9:04:36 AM UTC-5, Tim Fuller wrote:
>>
>>
>> I am trying to get into the scripting but I'm having trouble doing a 
>> simple operation.  Could someone please help me out or point me to the 
>> documentation that would lead to the answer?
>>
>
> http://leoeditor.com/cheatsheet.html#scripting
>
> EKR
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread Edward K. Ream

On Friday, July 31, 2015 at 9:04:36 AM UTC-5, Tim Fuller wrote:
>
>
> I am trying to get into the scripting but I'm having trouble doing a 
> simple operation.  Could someone please help me out or point me to the 
> documentation that would lead to the answer?
>

http://leoeditor.com/cheatsheet.html#scripting

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Scripting Question

2015-07-31 Thread Edward K. Ream
On Fri, Jul 31, 2015 at 8:58 AM, Tim Fuller  wrote:

> Hello All,
>
> I've recently discovered Leo and really loving it.  I am trying to get
> into the scripting but I'm having trouble doing a simple operation.  Could
> someone please help me out or point me to the documentation that would lead
> to the answer?
>
> I'm wanting to write a simple script that would take the highlighted node
> and clone it to an action item list.
>
> So, I'm wanting to clone a node as a child to
> ​​
> ActionItems.  I've gotten as far as tmpNode = c.p.clone()  And
> tmpNode.paste() works exactly as expected.  I just can't figure out how to
> dictate where to paste it.
>

​Let p = tmpNode Try p.moveToLastChildOf(​ActionItems) or
p.moveToNthChildOf(ActionItems, n)

You must also do a c.redraw() to make the change visible.

If you use the standard nomenclature (p, p2) etc, you can use typing
completion (Alt-1) to discover appropriate methods.

Edward

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.