Jump to content

Merging with Another Language


Guest BL@(K-R34P3R

Recommended Posts

Guest BL@(K-R34P3R

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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
Link to post
Share on other sites
Guest BL@(K-R34P3R

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.

Link to post
Share on other sites

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.

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

    No registered users viewing this page.

×
×
  • Create New...