Thank you for your post.
I can definitely duplicate the problem. Unfortunately, I don't know if this is designed this way, so I have forwarded your entire post to our Development and Software Quality Assurance (Testing) departments for comments. I will post again when I hear more information.
For the mean time, use a global variable.
I ran into a similar thing yesterday- I was trying to pass on the Script Parameter from a script to on OnTimer script using Get ( ScriptParameter ) as the parameter but the OnTimer script didn't get it. After a while it occurred to me that the OnTimer argument is evaluated when the script runs *not* when it is initially called - this can be confirmed by passing Get ( CurrentTimestamp )
It would be good to know whether this is by intended behavior or a bug - I don't see any mention of this behavior in the documentation.
I can't immediately see any advantage in evaluating at runtime and I think that evaluating at call-time would be more 'expected'
Here is some updated information from Development...
"The current behavior is consistent with all other script triggers. When you install an OnTimer script, the calculation expression is saved and evaluated when the OnTimer script is actually triggered (which could be hours later). At that time, there won't be a value for Get (ScriptParameter) because we never fire OnTimer during execution of another script. If you want to save a value for later, I suggest using a global variable. This calculation evaluation at time of trigger is the same as all other script triggers."
This seems to confirm what "TomElliott" posted.