Sending messages to Indicator

Indicator is a small window that is displayed in the upper-right corner of the screen when the scripts are being executed which displays the information about the processes taking place at the given moment of time. With the help of the Indicator object, we can display our messages in this window.

How to do it...

In order to display messages in the Indicator window we need to perform the following steps:

  1. The following script demonstrates basic possibilities of work with Indicator:
    function testIndicator()
    {
      Indicator.PushText("Waiting for ABCD process...");
      Log.Message(Indicator.Text);
      if(!Sys.WaitProcess("ABCD", 10000).Exists)
      {
        Log.Message("Process not found");
      }
      Indicator.Clear();
      aqUtils.Delay(5000, "Waiting 5 seconds...");
      Indicator.Hide();
      aqUtils.Delay(5000, "Waiting 5 more seconds...");
      Indicator.Show();
    }
  2. This function will first show the Waiting for ABCD process... message and put the message from the Indicator object to log.
  3. Then Indicator.Text will be cleared and a new message Waiting 5 seconds... will be shown.
  4. The last message sent to the Indicator object, Waiting 5 more seconds..., will not be visible since we hide the whole Indicator object before posting it.

How it works...

With the help of the PushText method, we place the text into the Indicator object that is possible to be read via the Text property. The Clear method clears the text in the Indicator object. The Hide and Show methods allow hiding and displaying anew the Indicator object on the screen.

If you would like to create a delay in the script with the help of the aqUtils.Delay method, you can also place an arbitrary text into the Indicator object, having passed it through the second parameter to the Delay method.

There's more...

The PushText method does not simply place a new text into the Indicator object, but rather retains the previously inputted text. Subsequently, the obsolescent text can be restored with the help of the PopText method.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.114.85