Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Expect to add support for the imacros API code
And need this after using System;:

using iMacros;

Macro Scripting C#, run Main function, args2
Copy      Help

//C# code
using System;
using iMacros;

class Test
static void Main()
,//add the exported C# code here
After the SetOptions line is deleted, the error still occurs
I don't have iMacros installed and don't know what assembly must be referenced.

I recommend:

Install some C# IDE, open an iMacros sample C# project, test it how it works there. Then you can see what iMacros assembly is used, and then can add the reference to the QM macro.

The best IDE is Visual Studio. Its 2015 Community Edition is free. It is very bloated, about 10 GB, installs tens of unneeded programs.
Another good IDE that I have tested is SharpDevelop. Normal size, fast to install.

Or don't use .NET. Instead use the COM dll. Either the type library or VBScript.
Use the following VB code can run successfully, but can only run on the iMacros browser, if I want to generate QM exe, in other computers how to run it? do not install iMacros can run it? I found iMacros, do not need to install can also be used directly, like portable software, but how to call it in the EXE file? thank you very much!

Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Copy      Help
str code=
;Dim macro
;macro = "VERSION BUILD=11.5.498.2403" + vbNewLine
;macro = macro + "TAB T=1" + vbNewLine
;macro = macro + "TAB CLOSEALLOTHERS" + vbNewLine
;macro = macro + "SET !PLAYBACKDELAY 0.2" + vbNewLine
;macro = macro + "URL GOTO=" + vbNewLine
;macro = macro + "TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:word CONTENT=ttkx" + vbNewLine
;macro = macro + "TAG POS=1 TYPE=INPUT:SUBMIT ATTR=ID:su" + vbNewLine
;macro = macro + "TAG POS=1 TYPE=A ATTR=TXT:TTKX<SP>|<SP>wait for you" + vbNewLine
;macro = macro + "'New tab opened" + vbNewLine
;macro = macro + "TAB T=2" + vbNewLine
;status = iim.iimPlayCode(macro)
VbsExec code
int w=win("iMacros Browser V11.5.498.2403" "*.Window.*")
lef 1350 12 w ;;push button 'Close'
in the sample, I see the following code, how to write code? let the imacros browser program and and QM generated EXE file to run together, Thank you!

@echo Example iMacros Batch File
@echo Tip: You may have to adjust iMacros default macros folder to iMacros\Macros\Demo

@REM %pf% expands to the right program location depending if it is x86 or x64 system
@set pf=%ProgramFiles%
@if not "[%ProgramFiles(x86)%]"=="[]" set pf=%ProgramFiles(x86)%

@REM %macropath% expands to the demo macros path
@set macropath=%~dp0..\..\Macros\Demo

"%pf%\Ipswitch\iMacros\iMacros.exe" -macro "%macropath%\FillForm.iim"
"%pf%\Ipswitch\iMacros\iMacros.exe" -macro "%macropath%\Loop-Csv-2-Web.iim" -loop 4

@echo Batch file completed
QM executes VBScript code with function VbsExec. Batch files - function RunConsole2. Everything else that you ask is not specific to Quick Macros and I don't know, please use iMacros forums.
IMacros help in the document to see the following picture of the VB code, the code is VB scripting language calls iMacros the com components, how to use QM syntax calls COM components directly? looked at QM help, not very understand, hope You can write a QM example of the code, and the picture below to achieve the results of the implementation of the VB code is the same, thank you very much!

typelib iMacros {40658C29-4C34-4CA5-9596-8F852BAE27BA} 1.0
iMacros.App x._create

Attached Files Image(s)
Macro Macro2732
Copy      Help
IDispatch iim1._create("iMacros")
int i=iim1.iimInit()

;then the same as VBScript


Macro Macro2720
Copy      Help
typelib iMacros {40658C29-4C34-4CA5-9596-8F852BAE27BA} 1.0
iMacros.App iim1._create

;then the same as VBScript
Use the first method, after running a reaction, but can not run the complete VB code, use the second method, run, no response!

Video presentation link:
You need to learn what is comments in QM.
Modify the following code, the code can be completed, but the operation is not the same as the prompt, you can help me look at the situation, thank you
Operation video link:

Macro Macro2
Copy      Help
IDispatch iim1._create("iMacros")
int i=iim1.iimInit()
int s

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

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

i = iim1.iimPlay("qm")

if i > 0
,s = "Everything OK"
,s = iim1.iimGetLastError()
mes F"{s}"

i = iim1.iimExit()
s must be str, not int. In QM there are many variable types, not just int.
Successful implementation of the code, thank you very much for your support! Smile
Using the selenium statement, I can add QM expression in the middle of the steps, how to generate iMacros in the middle of the VB statement, add QM expression? I recorded a video demo, I hope you can help me, thank you! Smile

Use the iMacros browser, very easy to record and modify the code, but does not support the complicated conditions of script writing, I want to use QM to write the script, do not want to use VB, I hope to help you the above questions, thank you very much
Macro Macro2758
Copy      Help
;assume the iMacros macro is:

;TAB T=1
;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter ON (No images downloaded from server)"

;and you want to insert QM code before TAG POS

IDispatch iim._create("iMacros")
int status=iim.iimOpen("")
str macro

;TAB T=1

mes "press ok to next"

;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter ON (No images downloaded from server)"
Thank you very much. I'll try it later!
Test passed, and very perfect, thank you!

I have a suggestion:

In the iMacros editor window, add an icon, click it, it will automatically iMacros code for processing, and then put the code into the system clipboard, and then automatically open the QM window, reminder: you can paste to edit Area, the code looks like the following picture!

Although the iMacros browser is required to purchase the license, but iMacros for IE, for firefox, for the chrome plug-ins are free, and with a free editor, so add this feature is very useful, and Selenium only firefox Plugin, and use it without iMacros simple!

Although the iMacros software can generate VBS code, but VBS does not QM recording, debugging, and so on more features, so the QM with this feature is great

Thanks again Smile

Attached Files Image(s)
I saw in the wiki help, running in a variety of browser code, also added to the above picture in the code

wiki help link: ... d_Overview

Attached Files Image(s)

Forum Jump:

Users browsing this thread: 1 Guest(s)