Hello,
I would like to integrate imacros into my c# application.
I spent all day looking around the net but all i found was examples in other programming languages. I could only find a few lines of code on the wiki manual which I couldn't understand (maybe because I'm a beginner programmer). The c# examples that were included with the download only seem to show mulit threading. That's great but I really need to know how to pass variables from my C# program to imacro and have imacro return values to my program. I have seen the examples in c++ and VB but I don't understand what is going on because its not C#.
Can someone please direct me to a tutorial or example in c# which shows how to send values to imacro, start the macro and have the values returned?
How to use with C# can't find adequate information
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
-
- Posts: 1
- Joined: Sat Apr 06, 2013 2:30 pm
Re: How to use with C# can't find adequate information
Initialize iMacros:
iMacros.AppClass imApp = new iMacros.AppClass();
iMacros.Status imStatus;
int timeout = 60;
Invoke iMacros:
imStatus = imApp.iimOpen("", true, timeout);
imStatus = imApp.iimPlayCode("URL GOTO=" + url, timeout);
For passing value and get data I do it like this.
example I need to increment the POS value on each tag and extract the text:
List<string> extractedData = new List<string>();
for(int i = 1; i <= 5; i++)
{
imStatus = imApp.iimPlayCode("TAG POS=" + i + " TYPE=SPAN ATTR=CLASS:NAME EXTRACT=TXT", timeout);
string data = imApp.iimGetLastExtract(1);
extractedData.Add(data );
}
iMacros.AppClass imApp = new iMacros.AppClass();
iMacros.Status imStatus;
int timeout = 60;
Invoke iMacros:
imStatus = imApp.iimOpen("", true, timeout);
imStatus = imApp.iimPlayCode("URL GOTO=" + url, timeout);
For passing value and get data I do it like this.
example I need to increment the POS value on each tag and extract the text:
List<string> extractedData = new List<string>();
for(int i = 1; i <= 5; i++)
{
imStatus = imApp.iimPlayCode("TAG POS=" + i + " TYPE=SPAN ATTR=CLASS:NAME EXTRACT=TXT", timeout);
string data = imApp.iimGetLastExtract(1);
extractedData.Add(data );
}
-
- Posts: 3834
- Joined: Mon May 31, 2010 4:59 pm
Re: How to use with C# can't find adequate information
Danny,
For passing variable values to your macro, use iimSet. To retrieve extracted values from your macro back into your program code, use iimGetExtract. These work the same regardless of the language you are calling them from.
For passing variable values to your macro, use iimSet. To retrieve extracted values from your macro back into your program code, use iimGetExtract. These work the same regardless of the language you are calling them from.
Regards,
Tom, iMacros Support
Tom, iMacros Support
Re: How to use with C# can't find adequate information
Some kind of Follow-up on this Thread by some New User... who preferred to post/open their Thread on SOF:
- How can I control IMacros using c#?
But OK, they are correct anyway about needing the 'Scripting Interface' to control iMacros from 'C#', only included in the Commercial 'iMacros Enterprise' Edition...
And Users/Customers with a License for the 'iMacros Enterprise' Edition have direct Access to TechSupport, so there is indeed not much "Expertise" on the (iMacros) Forum as those Qt's/Threads never reach the Forum actually, where it's more Users helping Users, mostly among Users using the Free Add-ons for FF/IE/CR...
- How can I control IMacros using c#?
... With one Reply/Answer:SJ10 wrote: I have been searching all over the internet and found only a few examples of how to send commands to Imacros, however, nobody has posted the way to actually use the examples. For instance,
"Initialize iMacros:""Invoke iMacros:"Code: Select all
iMacros.AppClass imApp = new iMacros.AppClass(); iMacros.Status imStatus; int timeout = 60;
"For passing value and get data I do it like this. example I need to increment the POS value on each tag and extract the text:"Code: Select all
imStatus = imApp.iimOpen("", true, timeout); imStatus = imApp.iimPlayCode("URL GOTO=" + url, timeout);
- by Equinox on Thu Sep 19, 2013 8:24 pmCode: Select all
List<string> extractedData = new List<string>(); for(int i = 1; i <= 5; i++) { imStatus = imApp.iimPlayCode("TAG POS=" + i + " TYPE=SPAN ATTR=CLASS:NAME EXTRACT=TXT", timeout); string data = imApp.iimGetLastExtract(1); extractedData.Add(data ); }
https://forum.imacros.net/viewtopic.php?t=20665
I cant get any of these lines of code to work, and I am not sure what I need to be using; and I don't know what to reference.
Do I need a special version of Imacros? Currently using the browser extension which I think is the problem, but even still, if I were to use the correct version, does anyone know what I need to be using;?
P.S. the issue is that I cant even access imacros with C#, please be mindful of this before marking this as duplicate.
Hum..., this @'Nic Endo' User is a bit of a "fake" User (for iMacros...!), ah-ah...!, as they answer since several months practically all iMacros Threads on SOF... (and now + 1 more User doing exactly the same since a few weeks), to each time only redirect them to the 'Kantu' Browser, tja...!Nic Endo wrote:Exactly. This will only work with the commercial version of iMacros, which includes a C# interface. If you just installed the browser extension, this is not there at all and there is no way to talk to it from C#.I need a special version of Imacros? Currently using the browser extension which I think is the problem
iMacros for Chrome used to have a free command line (similar to this), but looks like this is gone as well in the free version.
But OK, they are correct anyway about needing the 'Scripting Interface' to control iMacros from 'C#', only included in the Commercial 'iMacros Enterprise' Edition...
And Users/Customers with a License for the 'iMacros Enterprise' Edition have direct Access to TechSupport, so there is indeed not much "Expertise" on the (iMacros) Forum as those Qt's/Threads never reach the Forum actually, where it's more Users helping Users, mostly among Users using the Free Add-ons for FF/IE/CR...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...