First of all it would be nice to have all the code.
Second, why do you have spaces between $ and xdid and . and text? Not good.
Third, you will have an additional identifier inside of the (). As stated in the help file, you will need tree and branch. The parameter you are using as 1 2 and 3 should be the control item number. So if you created the TREEVIEW with XDIALOG (I think) then the first # would be the number you used.
Syntax:
$xdid(dialog, ID, PATH).text
Example:
$xdid(dcx, 4, 1 2).text
$xdid(treeview, 1, 1).text $xdid(treeview, 1, 2).text $xdid(treeview, 1, 3).text
^^ Is more of the format.. And Finally, $xdid().text only RETURNS a value. to SET a value (as you are doing in =), you need to do a xdid command. Read up on the docs and download a script like 'Dreams' for Buzzen to get an example.