Using eval variables in toolbar button tooltips

This button takes me to a network folder:

It works fine but the tooltip isn't perfect:

So I made my own but it seems I can't reference the variable. ="Go to " + newp will cause an error. I have to repeat the code

to make it look like this:

2024-05-06 - 14.05.05

(BTW: Why is there only one leading backslash?)

To sum it up: It's be nice

  • if the automatic tooltip could parse the eval code
  • if the tooltips could reference @eval/@evalalways variables
XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>Go CTC</label>
	<tip>=&quot;Go to &quot; + Replace(source, &quot;C:&quot;, &quot;\\CTC\C-WIN11&quot;)</tip>
	<icon1>#gonetwork</icon1>
	<function type="normal">
		<instruction>@evalalways:newp=Replace(source, &quot;C:&quot;, &quot;\\CTC\C-WIN11&quot;)</instruction>
		<instruction>Go PATH=&quot;{=newp=}&quot; USEQUALKEYS</instruction>
	</function>
</button>
1 Like

Maybe we need a @description or @tooltip similar to @label for this.

Re backslashes, I think literal ones should be escaped (i.e. doubled) in Evaluator code.

It's just the tooltip. The button runs fine and it looks okay with @output:

Ah yes, my mistake. Tooltips need backslashes doubled, since you can use \n to add a new line.

That's true...

... but is it the explanation?

None of the other backslashes in the path needed to be escaped to show.

Playing a bit more...

=" more \ \\ \\\ \\\\ \\\\\ backslashes"

... gives slightly unexpected results:

image

Maybe the Evaluator needs an EscapeString function like the Wild object.

Well, a minor thing.

13.6.2 will run any @evalalways lines in the button before calculating the description.

1 Like