print alias of an object? (SOLVED)

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.


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))

Perfect! Thank you.