Jump to content

AutoIt compatibality with java


pc_gurl
 Share

Recommended Posts

hello guys,

is it possible to link a program written in AutoIt with java??

plz if its advice me with a link to give help.

thank you very much.

i have to send data in the java program.

i.e if i detect mouse movement i have to send an order through the java program to the clients.

Edited by pc_gurl
Link to comment
Share on other sites

i have to send data in the java program.

i.e if i detect mouse movement i have to send an order through the java program to the clients.

depending on how your codes (java and autoit) are written, you shouldn't have too much trouble. If the java program is an applet, you're not going to be able to work with the controls etc, which would be an obstacle, but if it's a console application, you should have no issues passing values as command line parameters back and forth, and reading the output from the console as necessary. There are lots of posts about how to make your script accept command line parameters, or read from the console, both are possible with your java application also, assuming you're the one writing it. If you have to go with an applet for your java application, my suggestion would be to pass values via a text file, so that you can have the applet populate it's own controls etc. If you have no control as to the coding of the java application, ie: it's an applet you have to use for work and can't modify the code, i'd suggest getting the "DJ Java Decompiler" (freeware that i think i got from cnet a while back) to get access to the code, (assuming you can do so without getting fired), and translate it to your own autoit gui. you can then have it work exactly like the applet does, interacting with the same files etc, and you won't need to actually use their applet/application at all. That would be the most work however, that's why i suggest it as a last resort.
Link to comment
Share on other sites

depending on how your codes (java and autoit) are written, you shouldn't have too much trouble. If the java program is an applet, you're not going to be able to work with the controls etc, which would be an obstacle, but if it's a console application, you should have no issues passing values as command line parameters back and forth, and reading the output from the console as necessary. There are lots of posts about how to make your script accept command line parameters, or read from the console, both are possible with your java application also, assuming you're the one writing it. If you have to go with an applet for your java application, my suggestion would be to pass values via a text file, so that you can have the applet populate it's own controls etc. If you have no control as to the coding of the java application, ie: it's an applet you have to use for work and can't modify the code, i'd suggest getting the "DJ Java Decompiler" (freeware that i think i got from cnet a while back) to get access to the code, (assuming you can do so without getting fired), and translate it to your own autoit gui. you can then have it work exactly like the applet does, interacting with the same files etc, and you won't need to actually use their applet/application at all. That would be the most work however, that's why i suggest it as a last resort.

Thanks for your interest, i think i got what you are talking about but not that much, i am very new to AutoIT.

my java program is an application, and all what i want in the AutoIT script to do is detecting when mouse clicked or keyboard keystrock is pushed anywhere on the screen and pass it as a parameter for the java application, that for the sender side. and i have a reciever which will receive the data and execute the action sent.

plz it is very important to me to know how to do it i am stucked!

Edited by pc_gurl
Link to comment
Share on other sites

Thanks for your interest, i think i got what you are talking about but not that much, i am very new to AutoIT.

my java program is an application, and all what i want in the AutoIT script to do is detecting when mouse clicked or keyboard keystrock is pushed anywhere on the screen and pass it as a parameter for the java application, that for the sender side. and i have a reciever which will receive the data and execute the action sent.

plz it is very important to me to know how to do it i am stucked!

what information exactly do you want sent? the coordinates clicked? the data in the control clicked on? the text from some field?
Link to comment
Share on other sites

what information exactly do you want sent? the coordinates clicked? the data in the control clicked on? the text from some field?

i already did sending mouse coordinates in java.

the targe now is when the mouse is clicked a flag is set to be true,

and the receiver will check this falg if it is true it will do a mouse a click, that is for the mouse.

but for keyboard the sender should send which keystrock on the keyboard is pressed, an the receiver should press the same key. got it?

Link to comment
Share on other sites

it looks like it may help me if i linked it to java! but i didnt find it in the help file.

as far as actually 'linking' to java, you're not going to be able to interact with an already running application any more than you could with your keyboard and mouse. the way to link them together, is to have one execute the other, so that you can pass values back and forth... Really your easiest option may be to just do the whole project in one language or the other. Otherwise you may have to rework the way that the java app works all together...
Link to comment
Share on other sites

as far as actually 'linking' to java, you're not going to be able to interact with an already running application any more than you could with your keyboard and mouse. the way to link them together, is to have one execute the other, so that you can pass values back and forth... Really your easiest option may be to just do the whole project in one language or the other. Otherwise you may have to rework the way that the java app works all together...

ok if i could execute the java app from the AutoIt and vise versa i will be very happy, bcause it will help me a lot! do you have an example or a link, i am searching the internet but cant find anything fits my case.

sorry for bothering you but really i am very vey very new to AutoIT.

Edited by pc_gurl
Link to comment
Share on other sites

  • Moderators

You could probably use AutoIt within your Java application using the AutoItX3.dll. this way you may have no need for 2 applications, unless that's your preference.

But you could use FileInstall() for the java application, to use within au3.exe, then use a Run() command to execute the Java application .

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You could probably use AutoIt within your Java application using the AutoItX3.dll. this way you may have no need for 2 applications, unless that's your preference.

But you could use FileInstall() for the java application, to use within au3.exe, then use a Run() command to execute the Java application .

i don't know anything about the dll approach or whatever, but you can execute the java application from your script just by using a
Run('"C:\YourPath to Java\bin\java C:\Path to the java application\app Parameter1 parameter2 parameter3"')
Link to comment
Share on other sites

ok i will try what you all said tonight and replay back to tell you what happened with me, because i have to go to the university right now. THANK YOU VERY MUCH.

glad to help, hope it works out for you. worst case scenario, most of my day at work is spent on this forum, so if you have issues, let us know.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...