Returning a property from an object in another scene

I want to check, receive, return and edit properties owned by objects in other scenes.

If the object is know, what’s the best way to do this? Can I directly call/edit proerties of objects from other scenes? there doesn’t seem top be a bge.logic.getCurrentScene() equivalent of scenes by name. If there, is let me know.

Is messages the way to go even if I specifically know the object I’m interacting with? What is the exact code to query if a message has been recieved, EG "If own.received message "Message subject": do this"

•I have read all similar topics.
•I have read the documentation.

You could use bge.logic.globalDict
It’s a dictionary that can store things independent of scenes and objects.
Your one scene could write to the globalDict, then the other scene read from it.

e.g.
bge.logic.globalDict[“importantThing”] = scene.objects[“objectName”][“propertyName”]

Edit:
Alternatively you can use bge.logic.getSceneList(), which returns a list of scenes. That way I think you can access the object in the scene you want.

Use scene lists. Note: The scene that you’re trying to retrieve a property from must already exist before attempting to retrieve it, else it returns None or an error.

import bge

SCENE_NAME = "Scene_2"
OBJ_NAME = "Suzanne"
PROP_NAME = "Health"

def main(self):
    
    if self.sensors["Always"].status == 1:
        bge.logic.addScene(SCENE_NAME)
    if self.sensors["Always"].status == 2:
        for s in bge.logic.getSceneList():
            if s.name == SCENE_NAME:
                for o in s.objects:
                    if o.name == OBJ_NAME:
                        print(o[PROP_NAME])

A good way to do this is in a script controller with a property sensor so that every time a property changes it runs the script that writes to the file. Then in the other scene you can read from the file and set the property values to whatever they have been set to from the first scene. This would be done with each property being a new line in the file and reading each line into a list. Then every property is an index value in the list which you can access once the list is populated by the read script at the beginning of the new scene.