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

using iMacros;


Macro Scripting C#, run Main function, args2
Code:
Copy      Help
CsExec("")


#ret
//C# code
using System;
using iMacros;

class Test
{
static void Main()
{
,//add the exported C# code here
}
}
#32
After the SetOptions line is deleted, the error still occurs
#33
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.
#34
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
Code:
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=http://www.google.com/" + 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
5
int w=win("iMacros Browser V11.5.498.2403" "*.Window.*")
lef 1350 12 w ;;push button 'Close'
#35
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
@setlocal
@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
pause
#36
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.
#37
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)
   
#38
Macro Macro2732
Code:
Copy      Help
IDispatch iim1._create("iMacros")
int i=iim1.iimInit()

;then the same as VBScript

or

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

;then the same as VBScript
#39
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:

https://youtu.be/G2VnZmThRIM
#40
You need to learn what is comments in QM.
#41
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:
https://youtu.be/j_P966QfAYU


Macro Macro2
Code:
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"
else
,s = iim1.iimGetLastError()
,
mes F"{s}"

i = iim1.iimExit()
#42
s must be str, not int. In QM there are many variable types, not just int.
#43
Successful implementation of the code, thank you very much for your support! Smile
#44
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

Link:

https://youtu.be/v02lZNPx4c0
#45
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
#46
Macro Macro2758
Code:
Copy      Help
;assume the iMacros macro is:

;VERSION  BUILD=7500718 RECORDER=FX
;TAB T=1
;URL GOTO=http://demo.imacros.net/Automate/Filter
;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

macro=
;VERSION  BUILD=7500718 RECORDER=FX
;TAB T=1
;URL GOTO=http://demo.imacros.net/Automate/Filter
status=iim.iimPlayCode(macro)

mes "press ok to next"

macro=
;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter ON (No images downloaded from server)"
status=iim.iimPlayCode(macro)
#47
Thank you very much. I'll try it later!
Smile
#48
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)
   
#49
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:

http://wiki.imacros.net/Command_Referen ... d_Overview


Attached Files Image(s)
   


Forum Jump:


Users browsing this thread: 2 Guest(s)