Accessing name of the component in which the expression binding resides

I’m wanting to pass the name of a component to a script, the name being whatever component ran that script, instead of having to manually link each component in every expression. Is this possible?

runScript(“testing.test8”, 2000, {thisComponent.name})

runScript(“testing.test8”, 2000, {this.meta.name})

Thank You,

I am getting the following error with this.

[AWT-EventQueue-0] ERROR com.inductiveautomation.ignition.client.util.gui.ErrorUtil - Unable to find component for path: ‘this.meta.name’

That error to me seems like it’s looking for the component. Maybe try just passing {this}? it’s a stretch…

I tried {this} and {this.name}, neither of which give an error, but both pass “None” to the script. Or would “None” mean that there is literally nothing in the var holding what was “sent”?

My script is just printing out what is passed to it.

def test8(x):
	print(x)
	return 0

Here is the expression

if(runScript("test1.test8", 2000, {this.meta.name}),
	color(0,255,0),
	color(255,0,0))

runScript() borrowed the idea of argument passing from my objectScript() function, but not the rest of its features. You want to examine the binding value it supplies to scripts.

Start here:

Thank you, i will read up.