how do i rename an object with scripting?

 
how do i rename an object with scripting.
i know its not ObjectSetText(), that puts a lable on the object,
i am trying to rename objects that equal to the object color.

thanks in advance
 
Renaming of objects is not allowed. You can remove old object and create new one.
 
cool, thanks