Wait - For duration

Declaration

<AMWAIT SCALAR="number" MEASURE="minutes" />

Related Topics   

Description

Pauses task execution at the current step for a specific amount of time. The duration can be set to hours, minutes, seconds or milliseconds.

Practical usage

Typically used to wait a certain amount of time for something to occur (which is normally beyond the control of the task) before proceeding, such as when a specific condition starts, stops or changes. For example, wait 10 seconds to ensure a particular web page has completely loaded or wait 5 minutes to make certain a specific process has finished.   

Parameters

General

Property Type Required Default Markup Description
Wait for Number Yes (Empty) SCALAR="20" The duration of time to wait. This value corresponds directly with the Measure parameter (more details below).
Measure Text (options) Yes Seconds
  • MEASURE="milliseconds"
  • MEASURE="seconds"
  • MEASURE="minutes"
  • MEASURE="hours"
The time measurement to use in accordance with the value entered in the Wait for parameter. The available options are:  
  • Milliseconds - The duration will be measured in milliseconds.
  • Seconds - The duration will be measured in seconds.
  • Minutes - The duration will be measured in minutes.
  • Hours - The duration will be measured in hours.

Description

Error Causes

On Error

Examples

NOTE:
  • 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 task displays a message box asking how many seconds the next step should wait before proceeding and executes a 'Wait for duration' step according to the value (in seconds) specified.

Copy
<AMVARIABLE NAME="duration" />
<AMSHOWDIALOG ACTIVITY="input" MESSAGE="How many seconds should the next step wait before proceeding?" DEFAULTVALUE="5" RESULTVARIABLE="duration" WINDOWTITLE="Wait Duration" ICON="information" />
<AMWAIT SCALAR="%duration%" />
<AMSHOWDIALOG>Well, what do you know! %duration% seconds has passed. Thanks for participating.</AMSHOWDIALOG>