Multiple file browsers (different files) using python I'm trying to find a way to bring up two file browsers (one after the other), but without success.
The reason for needing multiple file browsers is that I first need the user to export a text file, then export a mesh file. Those could have different names and be exported to different directories.
One solution I could think of is to have a separate operator that I call from the first operator, but the problem seems to be that 1. it doesn't return a value and 2. the code pause while I call the other operator.
I also tried to add multiple fileselect_add calls, but that seemed to crash blender. Any idea?
Sample code:
import bpy
from bpy_extras.io_utils import ExportHelper

class ExportCommon(bpy.types.Operator, ExportHelper):

    bl_idname = &quot;export.common&quot;
    bl_label = &quot;Export common&quot;
    bl_options = {'PRESET'}

    filename_ext = &quot;.fbx&quot;

    def invoke(self, context, event):       

        context.window_manager.fileselect_add(self)

        return {'RUNNING_MODAL'}

    def execute(self, context):

        print(self.filename)
        return {&quot;FINISHED&quot;}
If I understand your question clearly, you want to proceed with the first modal result and run the second operator right?
Instead of calling two modal operator, you should call the second one in the first operator &quot;execute&quot; function. In that block, the modal part is done and can call another modal operator.
A simple snippet that run two file select window in a sequence:
import bpy
from bpy_extras.io_utils import ExportHelper

class ExportCommon(bpy.types.Operator, ExportHelper):

    bl_idname = &quot;export.common&quot;
    bl_label = &quot;Export common&quot;
    filename: bpy.props.StringProperty()
    filename_ext = &quot;.fbx&quot;

    def invoke(self, context, event):  
        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}

    def execute(self, context):
        print(self.filename)
        bpy.ops.wm.save_as_mainfile('INVOKE_DEFAULT', copy=True)
        return {&quot;FINISHED&quot;}

bpy.utils.register_class(ExportCommon)

bpy.ops.export.common('INVOKE_DEFAULT')