ScriptSpot home

Forum topic · General Scripting

Total noob, How do you get an objects name from it's varable.

By bazzacad · 2008-04-24

Description

Hi guys I'm a total noob to Max Script & I'm stumblingly through it right now.
OK I know this one is right in front of me, but I can't figure out how to get an objects name as a string out of it's variable.
For example I have:

theDummy = Point
cont = newSpline[4][#MASTER][2].controller = point3_script()

And I know I can hardcode it like this:
cont.script = "$Point1.pos"

But how do I get "$Point1" out of the variable theDummy ?
I've tried stuff like:
cont.script = "$" + theDummy.name + ".pos"
But no luck... :(

Comments (1)
Jenne van der Meer

Bit late but ok...

1st of all why not just theDummy.pos then if you have your reasons execute is the way to go. something like

(execute ("$" + theDummy.name)).pos

would do.