Is there a way to set your popup tittle base on a variable?

Hi guys,

I’m new in the universal robot space and I’m trying to get familiar with the software.

I’m currently writing a script using the following function popup(s, title=“Popup”, blocking=False)

Currently I have a variable named Total that stores a value of 2.5.

I want the tittle of my pop up to be 2.5.

I have try the following methods, but nothing seems to work on my end.

popup("Test, title=“total”, blocking=False)
popup("Test, title=(total), blocking=False)
popup("Test, title=to_str(total), blocking=False)

Please let me know if there is a way on achieving this or if is even possible.

Thank you.

by the way the error that i get is the following.

OK so a couple of things I would suggest from your message

You say you have a variable name Total that stores a value of 2.5
but in your script you have total not Total . 2 different variables!
UR script is case sensitive so keep that in mind when using variables.
your also missing the closing Quotation marks after Test

popup(“Test”, title=Total, blocking=False)

1 Like

It also looks as though you might have an extra “ ) ” in your error message shown above (right after …title=to_str(total)’)’ < this one here) this may might be closing the popup script command creating an error with the rest of the script written after it.

Expanding the advanced view of the script (arrow at the bottom of that error message window) may give you better details.

Popup(“Test”, title=“to_str(total)”, blocking=False) should do it.

Additionally, I see that you have a script file name amount which I assume is to calculate total, and then you have your popup script line.

If total is not defined as a global variable in the amount.script file, your popup script line is not going to be able to access total.

thank you Hammerton,

I got to revise my spelling next time.