Skip to main content

TrFile_FindFolder (function reference)

By June 1, 2024June 4th, 2024Online Help, Troi File Plug-in
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 17 to FileMaker Pro 21 (2024)

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 17 to 2024 –> TrFile_FindFolder (filep4221) 2024-0604 19:39:11