What you can do however is define the string you want in the script and use some other special character such as ~ to take the place of the $. Define a second variable which then references the first which replaces the ~ character with a $.
set vTodayString = "~(Today());
set vToday = "=replace([vTodayString],'~','$')";
It's a hideous way of doing it, but it should work. I did this when using a variable to store an expression containing set analysis, which used dollar expansion within the definition for the set. Letting the script do the dollar expansion was generating an "internal error", hence this approach.
I can't see why you would want to do this for such a simple function, but it should help others out who may be doing something a little more complex.
Here is my set analysis expression for example:
// Set analysis string using ~ in the place of $ to prevent expansion
Wow, thankfully I wasn't the Only() one having this problem....
I have followed your recipe, but in order to get my new variable to work I must refer to it as $(variable). Is there any way to have variable be enough? (This is sufficient if I type the definition manually in the variable editor (CTRL-ALT-V)). The variable in question is, namely, being used in various nested expressions, so it would be nice to avoid this final dollar sign...
I believe you will have no option but to dollar expand the variable, as the idea is that you evaluate the expression within the variable and then use the result of that expansion to form your expression.
Using the square brackets just gets the literal value of the variable, without evaluating it, so the likelihood is it just wouldn't work syntactically.
I mean, I'm no expert, so anyone else from the forums who knows more about the technical syntax; feel free to pitch in and correct me...
Wow once again, and thanks for the quick reply! (Yes, I am aware of the email alerts... )
Actually, I didn't know that the 's made a difference, so I might play around a bit with those --- you never know.
(For now these expressions are hardcoded since, as mentioned, I haven't always had luck with the $(variable) notation because of expression nesting. But hey, I certainly am no expert regarding the subtleties of the dollar sign, so if there are any experts around, any help would of course be much appreciated!)