Jump to content

Merging with Another Language


Recommended Posts

Guest BL@(K-R34P3R
Posted

I'm writing a Java script right now. When it's done, I would like to have it run in AutoIt, how is this possible? I know that AutoIt is often used as a layer for other languages, to help with specific functions. Thanks.

Posted

You can try:

$jarpath = 'yourapplication.jar'
$jarpath = FileGetShortName($jarpath)
$arguments = '';Arguments (if needed)

RunWait(@ProgramFilesDir & '"\Java\j2re1.4.1_01\bin\javaw.exe" -jar "' & $jarpath & '" ' & $arguments)

Of course, check the position of your javaw.exe file.

Posted (edited)

So, you may try:

$path = 'yourjavascriptfile'

$r = RegRead('HKCR\.html',"")
$r = RegRead('HKCR\' & $r & '\Shell\Open\command',"")
If @error Then Exit;No browser
StringReplace($r,'%1',$path)

;Run($r,StringLeft($r,StringInStr($r,'\',0,-1)))
;OR
RunWait($r,StringLeft($r,StringInStr($r,'\',0,-1)))

Edit: Fixed a stupid sintax error (/s intead of \s)

Edited by ezzetabi
Guest BL@(K-R34P3R
Posted

No, I mean Java. I am using NetBeans IDE to script up some cool Interface stuff. I wanted to include the neat java objects into my autoit scripts to spice it up. I'll try your first suggest ezzetabi, I'll get back to you to tell you if it works or not.

Posted

The last solution is quite universal with 'few' changes.

For .jar file it may be:

$path = 'yourjavascriptfile.jar'
$arguments = '';Your arguments

$r = RegRead('HKCR\.jar',"")
$r = RegRead('HKCR\' & $r & '\Shell\Open\command',"")
If @error Then Exit;No Java VM
   
StringReplace($r,'%1',$path)
StringReplace($r,'%*',$arguments);This is different in W98, but I do not remember how is.

;Run($r,StringLeft($r,StringInStr($r,'\',0,-1)))
;OR
RunWait($r,StringLeft($r,StringInStr($r,'\',0,-1)))

And it should work always.

Guest BL@(K-R34P3R
Posted

Ok, I just got back from school. I'll try it out right now.

Guest BL@(K-R34P3R
Posted (edited)

This is what I wanted to add =)

Posted Image

Click to enlarge =)

Edited by BL@(K-R34P3R

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
  • Recently Browsing   0 members

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