Page 1 of 1

How to select next/prev node in script?

Posted: Thu Feb 17, 2011 11:18 pm
by lumpo
HI I'd like to add a script to a next and prev button (that also responds to a key combo) that will move the selection in the tree and (i) send a nodeup (which triggers my scripts) and (ii) actually acts like it has been clicked ie is hilited and the formatting script in mousedown is run.

At the moment I can get different nodes to be 'worked on' in script but can't get the hiliting etc of the new node.

Thanks for any advice

Re: How to select next/prev node in script?

Posted: Fri Feb 18, 2011 4:49 pm
by wilstrand
Hi Lumpo!

To hilite a node you can use the hilitedNodeIDs Tree property. Just set this property to the ID of the node that you want to select. It is not necessary to refresh the Tree. A script could look like this:

Code: Select all

on nodeUp theButton theNodeID
   set the hilitedNodeIDs of me to 7
end nodeUp
With my best regards