Setting automations to wait

Occasionally, there is a requirement to set a wait time between steps of a Process. In Robin, this can be achieved uing the “Wait” statemenet.

The most simple way to use the “Wait” statement is by setting the delay time in seconds.

In the example below, the Excel file closes and the Message appears to the user after 5 seconds.

Excel.Close Instance: ExcelInstance

Wait 5

Display.ShowMessage Title:'Excel Process' Message:'The Excel file has been closed.' Icon:Display.Icon.None Buttons:Display.Buttons.OK DefaultButton:Display.DefaultButton.Button1 IsTopMost:False ButtonPressed=> ButtonPressed

For cases that there is no specific time to wait, the Process can wait for a particular event.

For example, in the following section the process waits for the file “C:\Users.txt” to be created (if it does not already exist) before the execution Proceeds.

Wait (File.Exists File: "C:\Users.txt")
# Steps to perform after the file is created.

The list below includes the actions that may be used withtin a wait action. All these actions, measure if the set case is true or false.

  • Services.Installed
  • Services.Paused
  • Services.Running
  • Services.Stopped
  • File.Exists
  • Folder.Exists
  • Folder.Empty
  • System.ProcessRunning

To check that a case is not true, logical operators can be used. In the example mentioned above, to wait until the file is deleted, the logical statement “Not” can be used.

Wait (Not (File.Exists File: "C:\Users.txt"))
# Steps to perform after the file is deleted.