connect-to-iimrunner.vbs

(Copy URL in PhpBB Forum Format - Info)

From iMacros

Jump to: navigation, search

This example script starts the iMacros Browser via via the iimRunner.exe tool. It allows you to run the iMacros Browser (or Internet Explorer or Firefox) under the user that iimRunner.exe runs under, and not the user of the calling application.

You can test this by starting iimRunner.exe as a different user using the Windows "Run As" command from the context menu. Once start, imacrose.exe will run under the same user account.

Visual Basic Script:

Option Explicit
Dim iim1, iret
  
 MsgBox ("This example script connects to an already open instance of Internet Explorer with an active (open) IIM plugin. If it can not find one, it starts Internet Explorer.")
 
 set iim1= CreateObject ("imacros")
 
 msgbox ("This script connects to iimRunner to start the iMacros Browser. Use this technology for example to control the iMacros Browser from ASP or ASP.NET accounts.")
 
 i=  iim1.iimInit("-runner")
 
 if i = -6 then
   msgbox ("iimRunner ist not running. Please start iimRunner.exe first. You find this file in the iMacros program directory.")
   WScript.Quit(0)
 end if
 
 if i = -7 then
   msgbox ("The max. number of allowed iMacros instances is reached. You can change this limit in the simple.xml in the iMacros directory.")
   WScript.Quit(0)
 end if
 
 i = iim1.iimPlay("Demo-FillForm")
 
 msgbox ("Demo completed, press OK to close the iMacros browser.")
 
 i = iim1.iimExit
 WScript.Quit(0)
Personal tools