Set property to object name?

I’m trying to set a global (GameLogic) property to the name of a specific object when a script runs on it. The same script runs on a series of objects, and I need to change the name property depending which object runs the script.

This maybe has something to do with the code:

ObjectName = scene.getObjectList()["Object1"]

However I’m not sure how to implement it to do this. Any suggestions?

In semi-pseudo code it would be something like this:

if script conditions met:

   GameLogic.ObjectName = Owner.getObjectName()

After some digging I found a reference to the method getName().

Using Owner.getName()[2:] removes the “OB” that is set at the front of every object name, so you are just left with the name.

I’ll leave this post here for future reference.