Can you get a user defined file path from in a menu?

I noticed when using the subtype of either ‘FILE_PATH’ or ‘DIR_PATH’ when creating a string property to retain a user defined file path for saving the render output location, that this doesn’t work when placed in a menu only when in a panel or header or something. The folder icon appears but you can not click on it. Is it possible to get a user file path from within a menu?

You could try to invoke a file select modal operator via menu, not sure if this works for directories only too…

import bpy

class SimpleOperator(bpy.types.Operator):
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    filepath = bpy.props.StringProperty()
    filename = bpy.props.StringProperty()
    directory = bpy.props.StringProperty()
    files = bpy.props.CollectionProperty(type=bpy.types.PropertyGroup)

    def invoke(self, context, event):
        return {'RUNNING_MODAL'}
    def execute(self, context):
        s = "filepath = %s
filename = %s
directory = %s
files =
%s" % (
".join( for f in self.files)
        ){'ERROR'}, s)
        return {'FINISHED'}

def register():

def unregister():

if __name__ == "__main__":


Indeed. Many thanks.