How to receive correct file and directory paths from user? I want to receive import and export path from user. From this documentation I've known I can give the string property a sub-type which turns it to a file or directory selector, the problem is that they give a wrong path, some parts are replaced by &quot;..&quot; and some parts are not typed at all.
I want to receive those paths from user to use them later when the user executes an operator (by clicking a button when everything is ready).

this is my code:
class myPaths(bpy.types.PropertyGroup):
    @classmethod
    def register(cls):
        bpy.types.Scene.myPaths = bpy.props.PointerProperty(type=myPaths)

    @classmethod
    def unregister(cls):
        del bpy.types.Scene.myPaths

    fileExportPath: StringProperty(
        name=&quot;export path&quot;,
        subtype=&quot;DIR_PATH&quot;,
        description=&quot;some description&quot;
    )
    jsonImportPath: StringProperty(
        name=&quot;import path&quot;,
        subtype=&quot;FILE_PATH&quot;,
        description=&quot;path of .json file to import.&quot;
    )
    fileName:StringProperty(
        name=&quot;output file name&quot;,
        description=&quot;Write file name without any file extension.&quot;
    )

How can I receive correct file and directory paths form user?
I found the solution here. use bpy.path.abspath(path) to get the absolute path to the file or directory.