The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "send-macro-code.vbs"
Line 2: | Line 2: | ||
Important: Each iimPlay run resets all settings and value from the previous iimPlay run. This means that you should not use one iimPlay per line, but first concatenate all commands and then send them to iMacros via the iimPlay command (as shown in this example). The browser context is preserved between different iimPlay, so one macro can continue where the previous one stopped. '''Only''' iMacros internal settings ([[SET]] command) are reset between different iimPlay. | Important: Each iimPlay run resets all settings and value from the previous iimPlay run. This means that you should not use one iimPlay per line, but first concatenate all commands and then send them to iMacros via the iimPlay command (as shown in this example). The browser context is preserved between different iimPlay, so one macro can continue where the previous one stopped. '''Only''' iMacros internal settings ([[SET]] command) are reset between different iimPlay. | ||
+ | |||
+ | Tip: To convert text macros (iim files) into inline code use the free [http://forum.iopus.com/viewtopic.php?f=8&t=7561 iMacros Code Creator]. | ||
+ | |||
Option Explicit | Option Explicit |
Revision as of 14:51, 19 November 2010
Instead of having the script call a locally saved macro, it can also "send" macro code directly to an iMacros instance.
Important: Each iimPlay run resets all settings and value from the previous iimPlay run. This means that you should not use one iimPlay per line, but first concatenate all commands and then send them to iMacros via the iimPlay command (as shown in this example). The browser context is preserved between different iimPlay, so one macro can continue where the previous one stopped. Only iMacros internal settings (SET command) are reset between different iimPlay.
Tip: To convert text macros (iim files) into inline code use the free iMacros Code Creator.
Option Explicit Dim iim1, iret Dim rn, i, keyword MsgBox ("This example script uses NO macros, but sends the macro code directly.") set iim1= CreateObject ("imacros") iret = iim1.iimInit Dim MyMacroCode MyMacroCode = "CODE:" MyMacroCode = MyMacroCode+"VERSION BUILD=5200814" + vbNewLine MyMacroCode = MyMacroCode+"TAB T=1" + vbNewLine MyMacroCode = MyMacroCode+"TAB CLOSEALLOTHERS" + vbNewLine MyMacroCode = MyMacroCode+"URL GOTO=http://www.iopus.com" + vbNewLine MyMacroCode = MyMacroCode+"URL GOTO=http://forum.iopus.com" iret = iim1.iimDisplay("Start demo") 'Run the first macro iret = iim1.iimPlay(MyMacroCode) if iret < 0 Then MsgBox "Error in Macro#1: "+ iim1.iimGetLastError() End If 'Run the second macro (one line only) iret = iim1.iimPlay("CODE:URL GOTO=http://www.iopus.com/imacros/irp") If iret < 0 Then MsgBox "Error in Macro#2: "+iim1.iimGetLastError() End If iret = iim1.iimDisplay("Script completed.") MsgBox "Close iMacros browser" iret = iim1.iimExit WScript.Quit(0)