Activate does not fire onPress.
Press is a Click event, meaning mouse down and up inside the Control. You can trigger it via script by setting Press = true (which fires the onPress event), but the "Press" property immediately resets itself back to False so that its ready for the next press.
De/Activate is similar to a check box's Un/Checked events. You can fire the OnActivate event by setting Activate = True, but unlike Press, the property retains the True value until you change it to False. When you do change it to False, the onDeactivate event fires. Note that for either of these events to be fired, a "Switch" must occur. For example, If the Activate is already True, attempting to set it to True again will not fire the associated event.
As for your data passing issue, getting the script passed rather than its value typically indicates one of two problems...
A) Your pathing is wrong, so the data you're trying to access isn't located where your path is pointing. Usually means you're missing a "Parent" tag. Remember that each level of object nesting in your xml introduces another level of "Parenting" if you're pathing through it.
B) You're attempting to assign the value of an expression without evaluating the expression. Typically solved by assigning the value of the expression to a variable, then assigning the variable to your original target. A good way to debug this sort of problem is to temporarily add a visible textbox to your target window at the same level as the control you're trying to target. Target the dummy text box and tweak code until you're sure the script is dumping out the expected result, then change the target to whatever control you really want it going to.
|