print alias of an object? (SOLVED)

NecroDeath
23 Jul 2018, 15:33

Need a bit of help with a container script.

I am adding a 'script to run when trying to add an object'

First is moves that object to a different location which works fine :

MoveObject (object, UndertheTree)

Then I want to print a message that says, the 'insert name of object' has been thrown out of the tree.

I can call the 'object' by using: msg (object)

but it returns the name of the object not the alias, and it prints 'Object:' before naming it.


The Pixie
23 Jul 2018, 16:11

Try:

msg(object.alias)

Even better, use GetDisplayAlias or GetDisplayName, which give the alias if there is one, or the name otherwise. One prefixes "a" where appropriate.

msg(GetDisplayAlias(object.alias))

NecroDeath
23 Jul 2018, 18:24

Perfect! Thank you.