Dialog
- Browse for folder
Declaration
<AMSHOWDIALOG ACTIVITY="folder" WINDOWTITLE="text" RESULTVARIABLE="text" DEFAULTFOLDER="text" ONCANCEL="text (options)" />
Description
Displays a standard 'Browse For Folder' dialog allowing the user to browse and select a specific folder during runtime. The selected folder is stored in a variable for use in subsequent steps. Execution is paused while the user makes a selection.
Practical usage
Commonly used to allow a user to manually select a folder to open during task execution.
Parameters
General
Parameter | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Descriptive text (displayed above the folder tree) | Text | No | (Empty) | TITLE="Select Folder" | The title that the dialog should display (for example, "Please select a target folder then press OK"). |
Populate variable with result | Text | Yes | (Empty) | RESULTVARIABLE="varname" | The name of an already created variable that should be populated with the folder selected by the user. |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Initial folder | Text | No | (Empty) | DEFAULTFOLDER="c:\foldername\" | The starting (highlighted) folder that the user sees when the dialog appears. |
On cancel | Text (Options) | No | Stop |
|
Specifies
how this activity should react if the user presses the Cancel
button. The available options are:
|
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task displays a 'Browse to Folder' dialog prompting selection of a folder. The path and folder name of the selected folder is then displayed in a message box.
<AMVARIABLE NAME="theFolder"></AMVARIABLE>
<AMSHOWDIALOG ACTIVITY="folder" WINDOWTITLE="Please select a folder" RESULTVARIABLE="theFolder" DEFAULTFOLDER="C:\" />
<AMSHOWDIALOG WINDOWTITLE="FOLDER SELECTED" COUNTDOWNDELAY="20">The folder selected is %theFolder%.</AMSHOWDIALOG>