TokTok123
TokTok123

Reputation: 771

AutoIt and Java -

I'm working with AutoIt and Java i.e. Swing and was kindly asking an AutoIt script can be closed from Java i.e. through a quit JButton listener in the swing based GUI.

Thanks.

Upvotes: 2

Views: 1495

Answers (2)

elsemieni
elsemieni

Reputation: 73

I don't think killing AutoIt process was a good idea.. It can cut some important tasks, (I don't know what are you doing with Autoit3, but anyways).

Basically you will ask for Java&AutoIT communication. (In this way, you can simply call a Autoit function wich task is close itself). There is several ways to do it.

  • Put a flag in somewhere, so If that "flag" is present, the script will be read it and it will close itself. Some ideas to do flags can will be envoriment variables, data on clipboard, some file, some registry entry, blah blah blah... or a dummy process that if you kill it from java, the script closes itself.

  • Another, more crazy idea is make a hidden GUI in you AutoIt3 excecutable with a Close button or something. So, if you want to end Autoit process, excecute your script AGAIN with some parameter ("myscript.exe end" for example), so the new instance of AutoIT script must search the hidden GUI and press that hidden Close button. (Well... if you can find and press buttons from Java, it will be nice, beacuse you don't need call your script for do that task).

Hope it helps :)

Upvotes: 1

FrontBack
FrontBack

Reputation: 124

I don't know Java, but you can simply close AutoIt3.exe or your AutoIt program's executable.

Upvotes: 0

Related Questions