Getting result from a popup dialog

Hi,

I did a popup to ask user some strings, but how to invoque and get the result ?

The popup is launched by another python class/file like that :
bpy.ops.object.location_operator(‘INVOKE_DEFAULT’)

The popup loks like that :


class LocationManager(bpy.types.Operator):    bl_idname = "object.location_operator"
    bl_label = "Manage location on anchors"

   
    result = {}
    
    def get_results(self):
        return self.result


    def execute(self, context):  
        self.result =  {"male" : self.male_string , "female":[]}
        
        return{'FINISHED'}


    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_props_dialog(self, 500, 500)

    def draw(self, context):
[...]
# The OK button in the dialog


class OnErrorOk(bpy.types.Operator):    
    bl_idname = "location.validation"
    bl_label = "Manage location on anchors"
    
    def execute(self, context):
        return{'FINISHED'}  


bpy.utils.register_class(LocationManager)

How can I run the popup and get the result (by getter ?) when user clic on OK ?

Thanks !

add an operator property and refer to it via self in execute() or invoke():

Thanks but I don’t understand how I can get the “result” var in the script that run this one.

I run the operator, the popup appear, I clic OK, execute() is called, but then I just don’t see how I can get the result…

Sorry I’m just scripting begginer, but I did not found example like that.

Thanks again.

The code which accesses the property should reside in the operator. It might break the Undo system otherwise I suppose.

Okay, but to access my dictionnary, how should I proceed please ?