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 box 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 box should display (e.g.,"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 box appears.

On cancel

Text (Options)

No

Stop

  1. ONCANCEL="continue"

  2. ONCANCEL="stop"

  3. ONCANCEL="fail"

Specifies how this activity should react if the user presses the Cancel button. The available options are:

  • Continue - The task will continue to the next step.

  • Stop (default) - The task will stop. No error is generated.

  • Fail - The task will fail with an error.  

Description

Error Causes

On Error

Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

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>