Imacros scripting interface - how to recreate in UIV?

The iMacros Enterprise Edition automatically installs theScripting Interface. You can control iMacros with any Windows programming language that supports the use of COM objects.

Almost all Windows programming languages support this technology, including the free Windows Scripting Host, Visual Basic 6, Visual Basic .NET, C#, Java, Perl, Python, C++, ASP, PHP, ASP .NET. On the iMacros homepage many examples for different programming languages can be found.

=> I know there is a command line API in UIV, but I am a bit lost on how to get started.

For example, how to convert the VBS script shown here:

'initialize Scripting Interface
Set iim1 = CreateObject ("IMacros")
i = iim1.iimOpen() 

' setting variables
i = iim1.iimSet("name", "Tom Tester")
i = iim1.iimSet("age", "34")

' displaying message
i = iim1.iimDisplay("This is a test")

' play macro
i = iim1.iimPlay("myfirstmacro")

' check success
If i > 0 Then
  s = "Everything OK"
Else
  s = iim1.iimGetErrorText()
End If
MsgBox s

' exit iMacros
i = iim1.iimClose()

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).

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:

PS: For more information see our iMacros alternatives help page