Reference > Script steps reference > Miscellaneous script steps > Get Directory
 

Get Directory

Sets a variable to the fully qualified path of a specified folder.

See also 

Options 

Allow Folder Creation lets users create new folders while they browse the file system.

Variable sets a local or global variable to the path of the selected folder. See the Set Variable script step.

Dialog title lets you specify a custom name for the folder selection dialog box.

Default location lets you specify the path that the folder selection dialog box displays when it opens.

Compatibility 

 

Product 

Supported 

FileMaker Pro Advanced 

Yes 

FileMaker Go 

No 

FileMaker WebDirect 

No 

FileMaker Server 

No 

FileMaker Cloud 

No 

FileMaker Data API 

No 

Custom Web Publishing 

No 

Runtime solution 

Yes 

Originated in 

FileMaker Pro 14.0

Description 

This script step prompts the user to select a folder, then it sets a variable to the fully qualified path of the selected folder.

In Windows, the path format is /Drive:/<selected folder>/.

In macOS, the path format is /DriveName/<selected folder>/.

Example 1 

Opens a folder selection dialog box that displays the desktop, prompts the user to select the Pictures folder, then sets Products::Pictures Folder to the path of the selected folder.

Get Directory [$DIRECTORY; "Select the Pictures folder"; Get(DesktopPath)]
Set Field [Products::Pictures Folder; $DIRECTORY]

Example 2 

Performs a find, prompts the user to select a folder to export to, then loops through records to export files that are in the Products::Picture field.

Perform Find [Restore]
Get Directory [Allow Folder Creation; $DIRECTORY; "Export to Folder"]
Loop
Set Variable [$PATH; Value:$DIRECTORY & Products::Picture]
Export Field Contents [Products::Picture; $PATH ; Create directories: Off]
Go to Record/Request/Page [Next; Exit after last: On]
End Loop

Related topics 

Creating file paths

Script steps reference (alphabetical list)

Script steps reference (category list)