Imacros scripting interface - how to recreate in UIV?

Nice question. You can achieve exactly the same what the iMacros Scripting interface does with the UIV RPA command line.

Sample code for VBS, Powershell, Python,… etc can be found here:

In the following I explain how to replace each imacros scripting interface command by the corresponding UIV code. (VBS example code, same works also in Python etc).

iimOpen()

This is done by starting the browser (Chrome, Edge, Firefox) directly using a special URL:

iimSet()

In UIV RPA you can use the special command line parameters &cmd_var1, &cmd_var2,… to send values from the script to the macro/browser extension:

In the macro you can retrieve these values in the ${!cmd_var1}, ${!cmd_var2},… variables.

iimDisplay

You can instruct the UIV extension itself to display a popup with the ECHO command:

iMacros Alternative: iimDisplay

iimPlay

We provide sample code for a “PlayAndWait” function in many programming languages. This can be used whereever you use(d) iimPlay in your script.

You can start many macros directly after another by calling “PlayAndWait” and then again “PlayAndWait”.

iimGetErrorText

The “PlayAndWait” function also retrieves the error message/success message from UIV. See the image above (code marked in blue).

iimGetExtract

In iMacros logic, this command returns the content of the !EXTRACT variable, which are the web-scraped values. Ui.Vision has no such variable, but there are other ways to get the content of macro variables in return after a macro is played:

In Ui.Vision you can retrieve the web-scraping results by saving them as CSV file, and then reading the CSV file from within your script.

Alternatively you can transfer information via the clipboard by storing it in the !Clipboard variable.

Also keep in mind:

Unlike iMacros, Ui.Vision supports flow control directly inside the macro! So in many cases you no longer have to transfer information back into your calling script to e. g. make an IF/THEN decision there. Instead you can create conditional decisions and loops over extracted data directly inside the Ui.Vision macros. This simplifies the script/macro creation and makes debugging easier.

iimClose

With UI Vision (UIV) you close the app by telling it via command to close after the macro is done. If you add &closeRPA=1 the UIV user interface is closed, and if you add &closeBrowser=1 then the browser is closed, too.

Note that all of this works on Windows, Mac and Linux. UIV is a cross-platform automation solution.

Here the the VBS script in action:

https://www.screencast.com/t/uLWHTBm13E

PS: For more information see our iMacros alternatives help page

1 Like