Prompt for filename in fileselect_add

Does anyone know if and how you can prompt for a filename in fileselect_add()
Also how to do the overwrite warning that happens with a normal file save.
Thanks
Yardie

Not sure what you mean, the entire file select modal operator is sort of a filename prompt…

sorry I should probably have said default
I found it ie self.filename assignment line in below (it didn’t work with other attempts but that was probably because of other errors in the code.

However it still doesn’t show the warning if the file already exists


class SelectFileLocation(bpy.types.Operator):
    """Write current shortcut keys to html"""
    bl_idname = "object.select_html_file"
    bl_label = "Select file to save html as"
    filepath = bpy.props.StringProperty(subtype="FILE_PATH")
    filename = bpy.props.StringProperty()
    directory = bpy.props.StringProperty(subtype="FILE_PATH")
    def execute(self, context):
        write_shortcuts_to_file(self.filepath)
        return {'FINISHED'}
    def invoke(self, context, event):
        self.filename = "keycodes.html"
        context.window_manager.fileselect_add(self)
        return {'RUNNING_MODAL'}