[Mesquitelist] script with mesquites
wmaddisn at interchange.ubc.ca
Thu Sep 11 20:51:08 PDT 2008
I believe Cuong has figured this out (based on off-list emails), but
I'll answer this for the sake of everyone else on the list.
First, I'll explain why this doesn't work:
"mesquite.trees.SimulatedTreeBlocks.SimulatedTreeBlocks" is the name
of a kind (or class) of modules. It is not referring to a specific
instance of this kind. In any run of Mesquite there could be several
instances of this kind of module: one could be operating within one
tree window, another could be operating within another tree window.
You need to specify which instance of this kind of module you want.
Why did your second snippet of script work? Here it is:
newTaxa 10 Species;
All commands in the script are being sent to whichever object you are
currently "telling". This is usually some module or another.
Presumably in the context of this second snippet, you are speaking to
the file coordinator module. The getEmployee command takes as its
argument a kind of module. It says "return to me the instance of
this kind of module that is your employee". Thus this command does
return a particular instance, which can temporarily be referred to by
"It". Thus, you really are commanding an instance in the second
By the way, you can store "it" for later use as follows:
newTaxa 10 Species;
At 5:16 AM -0500 14.8.2008, Cuong Than wrote:
>I have a very hard time using the scripting language of Mesquite. I
>don't think the documentation on it is good and detailed. Here are some
>problems I don't know to deal with, and I hope some of you can help me.
>- How can change the object to which I will send command to? As I know
>from the documentation, it can be done with a 'tell' command. However,
>this simply doesn't work in many cases. For example, I want to create a
>block of trees, and I send the following script to Mesquite:
> tell mesquite.trees.SimulatedTreeBlocks.SimulatedTreeBlocks;
> setNumberTrees 10;
>Mesquite says it cannot execute the script returns a null object.
>- In another script, I want to create a group of 10 taxa:
> getEmployee #mesquite.minimal.ManageTaxa.ManageTaxa;
> tell It;
> newTaxa 10 Species;
>It worked, but I don't know why.
>I would like to thank you in advance for your help.
>Mesquitelist mailing list
>Mesquitelist at mesquiteproject.org
Professor and Canada Research Chair
Depts. of Zoology and Botany and
Biodiversity Research Centre
Beaty Biodiversity Museum
6270 University Boulevard
University of British Columbia
Vancouver, BC V6T 1Z4 Canada
email: wmaddisn at interchange.ubc.ca FAX: +1 604 822-2416
Tree of Life: http://tolweb.org
Beaty Biodiversity Museum: http://beatymuseum.ubc.ca
Home page: http://salticidae.org/wpm/home.html
More information about the Mesquitelist