On Fri, 3 Jan 2014 13:07:33 -0800 (PST)
Jack Kuan <[email protected]> wrote:
> Hi,
>
> I have written a script and made a button for it. I can run it(click the
> button) on one selected node, but how do I make it run ALL selected nodes?
Assuming your script acts on `p`, do:
for p in c.getSelectedPositions():
do stuff to p
> Also, is there a find command that will let me execute my script on all
> found nodes?
I think the simplest would be to do the find yourself, in the script:
for p in c.all_unique_positions():
if my_target not in p.b:
# node's body doesn't include target string
continue
do stuff to p
Note that these approaches may be insufficient if "do stuff to p"
includes changing the structure of the outline, rather than just the
headline / body of p.
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.