Bracing myself for braces

Hi folks,

I have an installation command that requires braces in it. The parameters for the installation differ from machine to machine too.

The command looks like this

QualysCloudAgent.exe CustomerId={ID} ActivationId={ID2} WebServiceUri="https://someURL"

In the actionscript I have the following

QualysCloudAgent.exe CustomerId={parameter “CustomerKey” of action} ActivationId={parameter “ActivationKey” of action} WebServiceUri=“https://SomeURL

This of course fails as the {} are missing for the actual command line. I’ve tried escaping the braces but am obviously doing it wrong or need to concat strings or something. Any pointers?

QualysCloudAgent.exe CustomerId={{{parameter “CustomerKey” of action}}} ActivationId={{{parameter “ActivationKey” of action}}} WebServiceUri=“https://SomeURL

Above is the latest attempt to escape braces.

Does this work for you (it will open a CMD Promot with the command echoed in the CMD Prompt so you can validate the syntax is correct)

parameter "CustomerID" = "{{yourcustomerid}"
parameter "ActivationID" = "{{youractivationid}"

run cmd.exe /k "echo QualysCloudAgent.exe CustomerId={parameter "CustomerID"} ActivationId={parameter "ActivationID"} WebServiceURI="https://someURL""
1 Like

Do you know when something is some obvious you can’t see it?

action parameter query “CustomerKey” with description “Please enter CustomerId of the entity”

I was pasting in the key without the braces. Just included the braces as part of the input and it works fine. Thanks for the reply.

1 Like

I like the Hex encoding for braces as one method

q: "%7b  and   %7d"
A: {  and   }

Next way is to remember that in Action Script that the curly braces indicate relevance substitution, but you can escape them as needed by doubling them up, but it can be tricky to know which ones to double!

In your case, you could put the braces inside of the relevance, and then double the closing brace to avoid terminating the relevance substitution early.

QualysCloudAgent.exe CustomerId={"{" & parameter “CustomerKey” of action & "}}"} ActivationId={"{" &parameter “ActivationKey” of action & "}}"} WebServiceUri="https://SomeURL"

Or outside of the relevance and double up the first brace

QualysCloudAgent.exe CustomerId={{{parameter “CustomerKey” of action}} ActivationId={{{parameter “ActivationKey” of action }} WebServiceUri="https://SomeURL"

Or, you can do what you did, and just enter the braces into the parameter in the first place.

1 Like