How to use with C# can't find adequate information

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

How to use with C# can't find adequate information

by danny98752 on Mon Apr 08, 2013 1:19 am

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?
danny98752
 
Posts: 1
Joined: Sat Apr 06, 2013 7:30 am

Re: How to use with C# can't find adequate information

by Equinox on Thu Sep 19, 2013 8:24 pm

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 );
}
Equinox
 
Posts: 1
Joined: Tue Mar 12, 2013 6:55 pm

Re: How to use with C# can't find adequate information

by Tom, Tech Support on Mon Sep 23, 2013 3:36 am

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.
Regards,

Tom, iMacros Support
Tom, Tech Support
 
Posts: 3349
Joined: Mon May 31, 2010 9:59 am

Re: How to use with C# can't find adequate information

by chivracq on Tue Jul 10, 2018 1:21 pm

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#?
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:"
Code: Select all
iMacros.AppClass imApp = new iMacros.AppClass();
iMacros.Status imStatus;
int timeout = 60;


"Invoke iMacros:"
Code: Select all
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:"
Code: 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 );
}

- by Equinox on Thu Sep 19, 2013 8:24 pm
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.

... With one Reply/Answer:
Nic Endo wrote:
I need a special version of Imacros? Currently using the browser extension which I think is the problem

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#.

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.

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...! :roll:

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... :oops:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 7714
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Command Line and Scripting Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->