Problems with commands containing a backslash

If a command copied from the Dorico command list contains a backslash (“\”), it will not be executed and an error message will be displayed instead.

However, I can force the command to execute by replacing the single backslash (“\”) with a double backslash (“\\”) in the “to be sent” line.

(I tested this with the command for creating a pickup bar.)

If possible, this additional backslash should be automatically inserted into the send line when copying from the list above.

Great find, thanks.

What makes the most sense: changing a single backslash to a double backslash visibly in the command string, or keeping the displayed command as copied from the Dorico log and forcing a double backslash when sending the command?

Good question! :thinking:

The first option offers the advantage (e.g., for further testing) that you can completely edit the send string manually and be sure that no further changes will occur under the hood.

The second option is possibly less confusing, since you see the same strings in all windows.

Personally, I would probably choose the first option.

Maybe the best option is to replace single backslashes with double backslashes when importing the command from the Dorico log. That way, it will work as intended if you use it as imported, but you’re free to change it if you want to. :slightly_smiling_face:

1 Like

Another finding:

Even with double quotation marks ("), which appear in Dorico commands, a backslash must be added before them when sending.

This is how I got a command to work that sets all four page margins to 10 mm:

Project.Layout.SetOptions?LayoutIDArray=0&Dictionary=list: {string: \“pageSizeAndMarginOptions.pageMargins.margins.outer\”}\\, {string: \“28.346457\”}\\, {string: \“pageSizeAndMarginOptions.pageMargins.margins.inner\”}\\, {string: \“28.346457\”}\\, {string: \“pageSizeAndMarginOptions.pageMargins.margins.top\”}\\, {string: \“28.346457\”}\\, {string: \“pageSizeAndMarginOptions.pageMargins.margins.bottom\”}\\, {string: \“28.346457\”}\\, {string: \“pageSizeAndMarginOptions.pageMargins.extraMargins\”}\\, {list: {string: \“28.3465\”}\\, {string: \“28.3465\”}\\, {string: \“28.3465\”}\\, {string: \“28.3465\”}}&OpenScoreID=0