Jump to content
Sign in to follow this  
iLuvAutolt

Autoit with C#

Recommended Posts

iLuvAutolt

Hi all (Please bear with me with a boring lengthy intro),

I am not an IT person and consider myself a handymen-coder. I use an application for work that is hard to use, in that i have to manually keep feeding different inputs  that this application requires to do my job. It was so tedious that i started writing  c# code to automate this tedious tasks.

...then i stumbled upon Autolt today and loved it! I thought Autolt is so wonderful i made an instant donation!

I wrote my first script called RunMyApp and converted to an .exe.

ControlFocus("My App", "my form", "[NAME:CForm; ID:2]")
MouseClick ( "left" , 480, 220  )
AutoItSetOption("SendKeyDelay", 100)
Send("myInput")
send("{ENTER}")
ControlSend("My App", "my form", "[NAME:CForm; ID:2]", "{F5}") 

I then use this autolt created .exe in a simple c# code as follows:

System.Diagnostics.Process.Start(@"C:\RunMyApp.exe");
            label1.Content = "runnig my app";

What i really want is to  do is execute the RunMyApp with different value for myInput in the code Send("myInput").

Can some body show me how i can replicate this small Autolt script in c# code by making call to the  AutoItX class for C# being discussed here? 

Or alternatively can an autolt created .exe receive input from my c# code, i.e. can i send value for "myInput" variable to  Autolt created RunMyApp.exe from my c# code? 

Thanks for taking time to read this looonnnggg post :). Thanks in advance.

Share this post


Link to post
Share on other sites
JohnOne

If Not $CmdLine[0] Then
    Exit -1
EndIf

ControlFocus("My App", "my form", "[NAME:CForm; ID:2]")
MouseClick ( "left" , 480, 220  )
AutoItSetOption("SendKeyDelay", 100)
Send($CmdLine[1])
send("{ENTER}")
ControlSend("My App", "my form", "[NAME:CForm; ID:2]", "{F5}")
System.Diagnostics.Process.Start(@"C:\RunMyApp.exe", "myinput");
label1.Content = "runnig my app";

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
corgano

Maybe some STDin / out functions could be used. Look up STDread in the help file


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×