At the top of your @command node, you can do something like:

----
eval(g.findTestScript(c,'@common code'))
----

Where '@common code' is the name of a node somewhere in your outline.

(Thanks to Edward for that one, 3 years ago now! Wow, hard to believe I've been using Leo that long...)

-->Jake

On 2/5/2016 4:20 PM, jkn wrote:
I'm getting around to writing some useful @command scripts today, and I wondered about what is probably a faq:

does the whole body of an @command script have to live within a single node? I have several commands which have common functionality,
and I want to be able to do the equivalent of 'import <node>'.

The Scripting tutorial page tantalises with: "*you can create complex scripts from a node and its descendants*", but I think this
is referring to scripts written to external files.

Apologies if there is (as I suspect) a simple explanation of this somewhere.

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

Reply via email to