IBM Support

Escaping curly brackets in Actionscript

Technote (troubleshooting)


Problem(Abstract)

You can embed relevance in an actionscript with curly brackets "{}" when writing custom Fixlets/Tasks/Actions,. This is a very common and very useful method to use the flexibility of relevance to stick data into your actionscript.

Resolving the problem

When writing custom Fixlets/Tasks/Actions, you can embed relevance in an actionscript with curly brackets "{}". This is a very common and very useful method to use the flexibility of relevance to stick data into your actionscript.

Here is a simple example of setting a registry key with the current time:
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix]" "Example"="{now}"

When the action is run, the agent will substitute the results of the relevance expression as a string inside the curly brackets. More information about relevance substitution in actions is available in the action guide documentation athttps://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/Tivoli%20Endpoint%20Manager/page/Fixlet%20Authoring

Escaping Open Curly Brackets in Actionscript

But what if you want to use curly brackets in your action but do NOT want to use Relevance substitution? In this case, you need to "escape" the open curly bracket. For example:
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\ExampleGUID\{{00000000000-0000-0000-0000-00000000000}]" "Example"="Yes"

In this example the opening "{" is escaped with another curly bracket "{{". (but not the close curly bracket) so that the agent knows not to treat the curly brackets as relevance substitution. If you forget to escape the curly bracket, the action would have failed with a "Relevance substitution error" (because it didn't know how to evaluate the guid as relevance).

Escaping Close Curly Brackets in Actionscript

There is another (less-common) issue if you are using curly brackets in a relevance expression in relevance substitution. In this case, you need to escape the closing curly bracket. For example:
regset "[HKEY_LOCAL_MACHINE\Software\BigFix\ExampleGUID]" "NumGUIDSubkeys"="{number of keys whose (name = of "{00000000000-0000-0000-0000-00000000000}}" of key "HKEY_LOCAL_MACHINE\Software\BigFix\ExampleGUID" of registry}"

In this example, a relevance expression was embedded in the action surrounded by {}, but since there was a close curly bracket "}" in the relevance expression, it needed to be escaped "}}" to prevent the agent from getting confused and thinking the relevance expression was terminated.

Note that it is never necessary to escape curly braces in Relevance unless you are using relevance substitution in an action.

Historical Number

1230

Document information

More support for: IBM BigFix family

Software version: All Versions

Operating system(s): Platform Independent

Software edition: All Editions

Reference #: 1506259

Modified date: 13 December 2013


Translate this page: