In TrEd macros as well as in TrEd itself tree nodes are represented by FSNode objects. They are basically only references to hash tables where the attribute-name/attribute-value information is stored as a key/value pair. Moreover, the FSNode object provide a few methods to access the node's neighbors in the tree.
The macro invoked by user action (e.g. pressing the keyboard shortcut assigned to the macro) may use the following global variables (declared within the TredMacro namespace, but exported by default to other derived contexts) to refer to the active node and to the root of the active tree (how to access any tree in the file will be told later):
Points to the active node in the current tree. Macros may use this variable to access the active node as well as to make other node active (by assigning a different node reference to it).
Points to the root of the current tree. Macros may use this variable to access the root of the tree and (consequently) to access the whole tree. However, all assignments to this variable are ignored by TrEd.