FileManager
› getNewFileParent
FileManager.getNewFileParent() method
Gets the folder that new files should be saved to, given the user’s preferences.
Signature:
getNewFileParent(sourcePath: string, newFilePath?: string): TFolder;
Parameters
Parameter | Type | Description |
---|---|---|
sourcePath | string | The path to the current open/focused file, used when the user wants new files to be created ‘in the same folder’. Use an empty string if there is no active file. |
newFilePath | string | (Optional) The path to the file that will be newly created, used to infer what settings to use based on the path’s extension. |
Returns: