Are the parent nodes actually represented by the word “parent”? Or is there an icon that you are looking for? There are a couple of approaches that would work. If you have the word “parent” repeatedly or an icon representing a parent node, then you can use an image like this:
// start by finding all of the parent nodes
put everyImageLocation("parentNodeImage") into parents
// now click the particular parent that you want to work with
click item 3 of parents
But note that if you want to work with each of the parent nodes, you’ll probably need to use the “put everyImageLocation()” code before selecting each parent because adding child nodes will probably change the positions of the parent nodes on the screen. EveryImageLocation() looks for the specified image, but returns a list of coordinates where that image was found.
The other approach that might be necessary is to use text images. If the parent nodes are represented by dynamically generated strings, then you can search for those strings using text images. So lets say that you first create parent nodes called “Red”, “Yellow”, and “Orange” that are represented by those strings. To click on the “Yellow” parent node, you would use code like this:
Click (Text:"Yellow", TextSize:"12", TextFont:"Times")
The text properties used here are just examples; you would need to know or determine the actual properties of the font used to display the nodes.
Hope that helps.