Tooltips: Including Path Info and Special Characters

Looking at providing additional information in the Tooltips for Metadata on Tags.
Currently you can include Parameters within the Tooltip along with any String the user wishes to add.

Question:
1.) How would you include the full Folder Path information within the Tooltip for the Tag?
Example:(Say the Tag is in the following folder structure)
Plant
Area1 <-- Folder name
Equipment1 <-- Folder name
Motor1.Amps <-- Tag
I would like to show in the Tooltip: “Area1.Equipment1.Motor1.Amps”
2.) How do you add a Carriage Return Line Feed to the Tooltip so you can display multiple lines?

  1. if you have just a few tags, you can right-click on the tag and pick ‘Copy Tag Path’ which you can then paste into the tooltip and modify to your heart’s content.
    If you have a lot of them, then you can get it through scripting via system.tag.browseTags() and iterate through all of them.

  2. html formatting will do the trick.

<html>Line1<br>Line2<br>Line3...

Thanks for your suggestion Jordan.

For question #1 above I am looking for a more dynamic method to get this information.

For question #2 I may be misunderstanding something as I am not sure if you can add HTML to the Tooltip on the Meta data for a Tag (at least when I tried it didn’t seem to work). See my picture attached.


I’ll demonstrate question 2 first, since question 1 will require a bit more tooling around… or tooltipping around, if you prefer…



A shameless plug, I know. :laughing:

Okay. I've come up with a workaround.
In the UDT Definintion, put in a parameter hold the path... oddly enough, I chose 'Path'. :wink:




Running this script will put the path names (minus the instance name, of course) and stick it in the {Path} parameter.

tagList=system.tag.browseTags(UDTParentType="UDT_Test", recursive=True)

for tag in tagList:
  udtName=str(tag)
  pathName=str(tag.path).replace(str(tag.name),'')
  system.tag.editTag(tagPath=udtName,parameters={"Path":pathName})


Note that this is written for a specific UDT type (UDT_Test). This can be rewritten a bit to hit all UDT Instances. It would just take a bit longer to execute, since it would have to check every tag to see if it's a UDT. :slight_smile:

Also, it's not the most dynamic way of doing it. But it can be put into a gateway timer script to auto-refresh every so often.

1 Like

Thanks Jordan. Much appreciated.

Jordan,

That script is genius. I never would have thought of that and you just saved me a massive amount of time. Thank you, sir!

You are most welcome, sir! :slight_smile: