Skip to content

FileManager.getNewFileParent method

FileManager › getNewFileParent

Official

Gets the folder that new files should be saved to, given the user's preferences.

Signature:

getNewFileParent(sourcePath: string, newFilePath?: string): TFolder

Parameters:

ParameterTypeDescription
sourcePathstringThe 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?stringThe path to the file that will be newly created, used to infer what settings to use based on the path's extension.

Returns: TFolder

Since: 1.1.13