SetAttr META for strings including quotes

Failed to find any references to this in the help or online, but is there a way to include quotes in string values written to metadata fields via SetAttr META? Can they be escaped somehow, or represented as HTML or other characters entities? I’ve tested the following strings, using SetAttr META "Comment:{dlgstring|Enter comment:}":

"this is a quoted string" >>> "this

""this is a quoted string" >>> ""this is a quoted string"

"this is a quoted string"" >>> "this

""this is a quoted string"" >>> ""this is a quoted string""

I'm not sure there is a way at the moment, but we're thinking about adding one, if we can avoid breaking existing buttons etc.

Cool, thanks. I guess ideally it should apply to more than just SetAttr META, of course, such as {dlgstring}/{dlgstringS} wherever they are used, etc.

This button

SetAttr META comment:{dlgstring|Enter comment:}

with this input

"this is a quoted string""

will have a this result

"this is a quoted string"

Not a universal solution, though:

this is a string

will end up as

this

Maybe the universe's way of telling us that quotes are not meant to be used in fields? :wink:

That did not work for me, as indicated in my original post.

Well, I’m sure with the :wink: you mean that in jest anyway, but just thought I’d point out that we can enter quotes in metadata string fields to our hearts’ content when doing so via the Set Metadata panel. It seems that {dlgstring} is the limiting factor for doing it programmatically, though I don’t know if a script could maybe bypass that limitation.

In the next beta, VB-style double quotes will work within quoted strings:

SetAttr META "comment:This comment has ""a quoted string"" in it."
SetAttr META "comment:{dlgstring|Enter comment:||doublequotes}"

Excellent, thanks.

Embedded quotes in arguments is in today's new beta: Directory Opus 12.23.2 (Beta)

Thanks for the heads up @Leo . I’ll give it a whirl.

Looking good, @Leo … works as expected. Thanks again.

1 Like