I was testing a new script. Since the value can be multi-line, I wanted to return different values depending on the context.
According to the manual, ScriptColumnData.value is used for display in columns and most places, while ScriptColumnData.markup is used in few places like tooltips.
So for tooltips, where ScriptColumnData.markup should be used, I was including a line break. But it seems that the line break is also showing up in the columns.
Thanks Jon, so how can one specify the value depending on the context?
So for tooltips, include the line break, and for anything else, use a different separator.
I'm not sure there's a good way to do that. Even if we pass through an indicator of why the value is being requested, the value is cached once it's been calculated and would be used for other things as well. It might be better for you to have two separate columns if you need their content to be different.
How about if ScriptColumnData.markup were used exclusively for infotips, tooltips, etc, and ScriptColumnData.value for everything else?
It wouldn't matter if Opus caches the data, I assume it already caches both values?
For the record, I'm passing one value to ScriptColumnData.value and a different value to ScriptColumnData.markup. Regardless of the fact that columns now also support markup, why are there 2 properties to set the value? One overrides another?
Couldn't the markup property value be restricted to infotips only?
But columns support markup as well. The non-markup value will be used for things that don't understand markup (or e.g. when searching or filtering when you would never want markup in the generated text).
No they can't, not properly, and maybe that's the issue here. If we made it so linebreaks got stripped out (converted to spaces) when displayed in the columns would that solve the problem for you anyway?
Not really, no. And it's not an actual problem, so don't worry. But thanks.
I was just curious. I imagined, based on how it's described in the manual, that it worked differently.
Let me see if I got this right: if I set both properties, Opus will use the .markup value to display in columns, etc., but the .value one for searches and similar?
In that case, eg. for a column declared as "number", if I set its numeric value in .value but append some text in .markup as a unit, does that mean the column will display the number+unit but behave as numeric in searches? That's it, a way to display one value while internally handling another.
Think of value as the intrinsic value of the column. markup is meant to be the same value but represented with markup if needed. Things that understand markup will show the markup value, other things will use value, but the idea is they convey the same information.
It kind of looks like it does. But .markup is converted to the same type as the column, right? So if the type is numeric, .markupwill be converted to a numeric value as well.
If only could be left as plain text, then I guess this would be possible.
But that's way off topic.
Thanks for the explanation.