# Calculator Action Button with Dialog

Let's consider an example of a robot that shows how to "add" your button to the window of another application and perform a specific action when clicked, in this case - displaying a dialog window with text and a link. Before running the project, the Calculator must be launched (verified with Windows 10).

The robot project consists of a single diagram. Thus, if we describe step by step, this robot works as follows:

1. Creates a button for the calculator "Show our hint" using the [Window Editor](https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/rabota-v-sherpa-designer/osnovnoe-menyu/panel-razrabotka/menyu-dopolnitelno/redaktor-okon).
2. After clicking the created button, it shows the modal window created in the "Window Editor" with a hint and a link to the calculator in Google Chrome.
3. After clicking the link, it launches the calculator in Google Chrome, and after clicking the "Close" button, it closes the modal window.

The project diagram looks like this (for convenience, the diagram blocks are numbered):<br>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd9Q74m933XbFrtWtKk1KK-0Hsr2tAFTuniCK3AhkpLwFUsKrNkS0Hyq7ZZmCMkEbneBUfkVddvXSGCERfFAeM8ShP3YTBXOlWbe95SHwKHBzekf1qDJozuothAeEcHB0lmuAo8TeS_tNNnY1pGlCiRNydF?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

1. **"Start" Block** (any diagram begins with this block).
2. **"Show Button for Calculator" Block** allows you to create your own windows (forms) and display them in modal and non-modal mode, including asynchronously relative to the flow of the script. If a selector is specified, the coordinates of the created window will be bound to a control element in another application. To create and edit your window, use the "Edit..." button of the block, and to create reusable windows - the "Window Editor" button on the main toolbar. The following properties are specified for this block:

* Configuration (configuration string);
* Window Object (variable with the window object);
* Selector (identifier of the element to which the window is bound when displayed);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* Binding Angle (selection of the binding angle value of the window, when a selector is specified, the binding angle value indicates the binding of the top-left corner of the window to the corner of the found element);
* X Offset (offset on the X coordinate when displaying the window);
* Y Offset (offset on the Y coordinate when displaying the window).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfQutQ7GnRKyv8ZDtj84oiqMndaEZT9guKsqv1q2mqpBNIPo0ODTtuF8EULskfCm_awVKWP4XY4n_UouPXFS3aXNAsWXlgERMu4ISdWzn9NcrpPO65563drrZFfVozWF_ovFj9tN9D-u13gXGAlbJDM9yU?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

The button shown by the block is created using the "Window Editor" tool.

You can view and edit it by clicking the "Edit..." button located inside the block.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfVdNey6Jpwvul2fu6ru4ybsCrwy5JcXtkHTLjocXT11PQWJrtS94i1AmN0a3Mks10F4Ij9N_djm-auc-bR--HJOMVw1Gapw2WEvJOBxaJc3DFsKlTtbFKLqrg2ydSGgtmrAbG9qbOCQuNpkwFIM1cGAbE?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

3. **"Condition" Block** checks the specified condition for truth, after which the script execution continues towards the "Yes" exit (if the condition is met) or towards the "No" exit (if the condition is not met).

The condition is written in the format: "variable" equals (==)/ greater than (>)/ less than (<) "value".

For example: $a == "Hello", that is, if the value of the variable $a is equal to "Hello", then the exit is "Yes", otherwise - the exit is "No".

$Result > 5, that is, if the value of the variable $Result is less than 5, then the exit is "Yes", otherwise - the exit is "No".

In this case, the condition of clicking the button is used, set as: $ControlEvent != "". That is, if the variable $ControlEvent is not empty, then the exit is "Yes".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc2KUtDKxeED8NSqAhXjxD0wiWA_ZC4MShKdOmQY3iocsjjKLAneWfeju2patKZGEyEyHdpC2TJj4NvoBDDOZ9m4X0TaTXVC-8k1rpP70Kb6cSPISSey7CVenTTVesz_DKGIqXVokr-XIbjMhO2Wr4fEtkd?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

4. **"Show Window with Hint and Link" Block** allows you to create your own windows (forms) and display them in modal and non-modal mode, including asynchronously relative to the flow of the script. If a selector is specified, the coordinates of the created window will be bound to a control element in another application. To create and edit your window, use the "Edit..." button of the block, and to create reusable windows - the "Window Editor" button on the main toolbar. The following properties are specified for this block:

* Configuration (configuration string);
* Window Object (variable with the window object);
* Modal (when the flag is set, the window will be shown as modal);
* Process ID (variable that stores the process identifier, indicates which application to work with);
* Binding Angle (selection of the binding angle value of the window, the value "Default" indicates the center of the element).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdSJ2yLkSHBunRTU64VmHr-ktK-mZ2cuYgjZux8Sggcf8LlOvuJqaz_wFxssqmlcYqfJInmKw1aaN5aXQgreasGULpKuR1tZpq8dvJlqE4qawMlXEdyLud-eYvc36P58_Lx5lz-cjn-kAwf-JvAIn_Hv7U?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

The window shown by the block is created using the "Window Editor" tool. You can view and edit it by clicking the "Edit..." button located inside the block.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0UVlMoXCCcXFnKGVNhNlaAnlJyJoe4wvj64kK4ZOw-UGr-tsb7LH86zhSP_uIHofnje_AfnvuY8dyBOnot5lB4-bd7fm8LltTycyQGQYANedVtC7c1yjX9CnWsW4KCFFUBH359xH229EEBKbkWSwA3YZM?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

5. **"Log" Block** allows you to output arbitrary messages and/or variable values to the log during the robot's script execution. The property "Value" is specified for this block. A text constant is indicated in quotes, and the variable name starts with the $ symbol. That is, this block writes the value of the variable to the robot's log.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcurrCc842ZXeenJxinhWZcUKxoBHmCPY8hg9v-DUIhOFO4rgDtW86ZblBG-Z8egsSZvH6boBlxNTXVTEdQBY6bbt1yQAQ-Cn9F-qLf0COz69TqTbigsuq2vu_FscWfYb2kr398wU08G4ATlgMgxZznnYE8?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

6. **"Condition" Block** checks the specified condition for truth, after which the script execution continues towards the "Yes" exit (if the condition is met) or towards the "No" exit (if the condition is not met).

The condition is written in the format: "variable" equals (==)/ greater than (>)/ less than (<) "value".

For example: $a == "Hello", that is, if the value of the variable $a is equal to "Hello", then the exit is "Yes", otherwise - the exit is "No".

$Result > 5, that is, if the value of the variable $Result is less than 5, then the exit is "Yes", otherwise - the exit is "No".

In this case, the condition of clicking the link is used, set as: $ControlEvent.Contains("LinkLabel"). That is, if the variable contains the text "LinkLabel", then the exit is "Yes".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOYoI-awn6I4dqEsuP6h1NgQs96U0wm68p29srr7kAB_BYntQ3NJeoELLYygNINYolne9HqUjDQy59Hl9blAJmFgK2vg3dlB18nbeA0qEZ4Y1-XDNv3pXHVJyGlgZs8MgDHFD953arre4sG_-uobHWbqrH?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

7. **"Launch Browser" Block** launches the selected browser. The following properties are specified for this block:

* Browser Type (the browser that needs to be opened);
* URL (the link that should open when launching the browser);
* Wait Time (the time to wait for the browser to open in seconds).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf8EdDnlYa69F7R6mFaOVJuVcYfCOWtRIsQqeqO9ShxtCD3nCcL2D6032j8X2RR4Fw4Mx-lqwt6OuOF63-hUsV81nHuYZUK5A4ypXXjXdgXFXJH_daF7SFYEmVYhHqjomccfLY2I4aL4qdxeGKBlGi7rcDd?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>

8. **"Condition" Block** checks the specified condition for truth, after which the script execution continues towards the "Yes" exit (if the condition is met) or towards the "No" exit (if the condition is not met).

The condition is written in the format: "variable" equals (==)/ greater than (>)/ less than (<) "value".

For example: $a == "Hello", that is, if the value of the variable $a is equal to "Hello", then the exit is "Yes", otherwise - the exit is "No".

$Result > 5, that is, if the value of the variable $Result is less than 5, then the exit is "Yes", otherwise - the exit is "No".

In this case, the condition of clicking the "Close" button is used, set as: $ControlEvent.Contains("CloseButton"). That is, if the variable contains the text "CloseButton", then the exit is "Yes".

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf1akdUiw2omDtGBYb1qmaTC8-s9fHNawllfIr_v10D8mkGtfbcN4_6EV9JidXs10WTly9c59qIZXMutsfbwi1nwy51joRZsWiRURj1wbPnH8V8mdMXD5Qx21Pp9Li86ptNsuDtiSUlbPB5Uu33vckdCd4?key=DhcpajRIrlTxITYaT99gBQ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/primery-robotov/calculator-action-button-with-dialog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
