Select a file from an invoke menu rather than ImportHelper or Panel What I'm after here is to give the user the freedom to either search for a missing image texture via file selector or replace it with a dummy image stored in the addon folder.

This is what I'm attempting to do:
class FixMe(bpy.types.Operator):
    &quot;&quot;&quot;Find or replace missing image texture&quot;&quot;&quot;
    bl_idname = &quot;object.fix_me&quot;
    bl_label = &quot;Fix Me&quot;

    file_: bpy.props.StringProperty(name= &quot;Image File&quot;, subtype='FILE_PATH')
    replace: bpy.props.BoolProperty(name= &quot;Replace with a dummy image&quot;, default= False)

    def execute(self, context):
        print(&quot;Selected image is&quot;)
        print(self.file_)

        return {'FINISHED'}

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

    def draw(self, context):
        layout = self.layout
        col = layout.column()
        col.label(text= &quot;Replace image&quot;)
        sub = col.column()
        sub.prop(self, &quot;file_&quot;)
        if self.replace:
            sub.enabled = False
        col.prop(self, &quot;replace&quot;)

I'm trying to get the selected file path using self.file_ but sounds that all the code in execute() does not run at all and an error find_node_operation: Failed for (DRIVER, 'cycles.seed') shows up in the console.
Adding Replace with a dummy image as an ImportHelper property will make the interface less intuitive, the user should be able to select that option in a single click rather than open a file browse window to do.
I'm aware that I can do that via Panels and Properties, but this will not fit into the use case I'm after in this particular situation.
Well, I've come up with a dirty workaround, by creating a new ImportHelper operator and added it to the menu. I couldn't think of a smarter approach that's why I'm not marking the answer as the correct answer.