Dialog - Save File

Declaration

<AMSHOWDIALOG ACTIVITY="save" WINDOWTITLE="text" 
RESULTVARIABLE="text" 
FILTER="text" DEFAULTFOLDER="text" 
ONCANCEL="text options)" />

Description: Displays a standard Windows 'Save As' dialog box allowing the user to save a specific file. The file name and location specified 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 save a file during task execution.

General Parameters

Property

Type

Required

Default

Markup

Description

Title of the message box

Text

No

(Empty)

TITLE="Save location"

The title that the dialog box should display (e.g., "Please browse for the target location").

Populate variable with result

Text

Yes

(Empty)

RESULTVARIABLE="varname"

The name of an already created variable that should be populated with the file or folder selected by the user.

Advanced Parameters

Property

Type

Required

Default

Markup

Description

Filter

Text (options)

No

All files (*.*)|*.*

FILTER="All files (*.*)|*.*"

The file filters for the 'Save File' dialog box. Filters represent the masks that are listed in the File Type drop-down. For example, to include only text files, enter Text files (*.txt)|*.txt.

Initial Folder

Text

No

(Empty)

DEFAULTFOLDER="c:\foldername\"

The starting folder for the 'Open File' or 'Save As' dialog (this is not supported in the 'Browse for Folder' dialog).

On Cancel

Text

Yes

(Empty)

ONCANCEL="fail"

Specifies how this action will 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 fail with an error.  

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

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

Description: Open "Save File As" dialog.  Populate the variable "theVar" with the selected filename.

<AMSHOWDIALOG ACTIVITY="save" WINDOWTITLE="Please select file 
to save" RESULTVARIABLE="theVar" DEFAULTFOLDER="C:\Temp" />