Phyton

From iMacros

Jump to: navigation, search

The iMacros Scripting Interface can be used from any programming or script language that can use the standard Windows COM object interfaces. The following example shows you how to call this interface from Phyton. The script initializes the Scripting Interface and calls a macro with name "SwitchProxy". It also contains a subroutine that prints out messages returned by the iMacros Scripting Interface.

 import win32com.client
 def Hello():
 import win32com.client
 w=win32com.client.Dispatch("imacros")
 w.iimInit("", 1)
 w.iimPlay("SwitchProxy")
 print w.iimGetLastMessage()
 if __name__=='__main__':
 Hello()