file browser by python in blender
I found this code sample (originally from the Blender wiki) to be very helpful in understanding file browser usage. Specifically, look at the &quot;execute&quot; method of the ScanFileOperator class, which passes self.filepath (the chosen file) to another function (scanFile):
#
#   Opens a file select dialog and starts scanning the selected file.
#
class ScanFileOperator(bpy.types.Operator):
    bl_idname = &quot;error.scan_file&quot;
    bl_label = &quot;Scan file for return&quot;
    filepath = bpy.props.StringProperty(subtype=&quot;FILE_PATH&quot;)
 
    def execute(self, context):
        scanFile(self.filepath)
        return {'FINISHED'}
 
    def invoke(self, context, event):
        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}