Skip to main content

TrFile_FindFolder (function reference)

Troi File Plug-in > Functions reference > TrFile_FindFolder
Troi File Plug-in for FileMaker Pro

TrFile_FindFolder

Returns the path to special folders (subdirectories).

SyntaxFunction badge

TrFile_FindFolder ( folderSwitch )

Parameters

folderSwitch specifies the name of the wanted special folder.

Returned Result

Data type returned

Text

Result

FileSpec The path to the folder.

If a special folder is not available for that platform $$-1 is returned.

Originated in

Troi File Plug-in 1.1

Compatibility

FileMaker Pro 16 to FileMaker Pro 2023

Considerations

Not every special folder is available for each platform.

Note that there is a trash folder for every volume. Currently this function returns the trash folder on the startup disk.

Some folders are no longer available on macOS, and will return $$-43 (file not found).

Example

Set Field [ result ; TrFile_FindFolder ( "-Trash" ) ]

This will return the full path of the Trash folder.

TIP: With this folder and the MoveFile function you can move items into the Trash. Be aware that each disk has its own trash, so there may be more than one trash. FindFolder returns the trash of the startup disk.

Example 2

Set Field [ gStartupDiskFolder ; TrFile_FindFolder ( "-Root" ) ]

This will return the top folder on the startup disk, for example “C:”.

Used in example file

FindFolder.fmp12

Related functionsFunction badge

TrFile_ListDisks
TrFile_MoveFile

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 16 to 2023 –> TrFile_FindFolder (filep4221) 2023-0601 15:20:38