Sign in to follow this  
Followers 0
Guest BL@(K-R34P3R

Merging with Another Language

8 posts in this topic

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.

Share this post


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.

Share this post


Link to post
Share on other sites

He means Javascript, not Java. Javascript runs in the web browser, not in autoit.


Who else would I be?

Share this post


Link to post
Share on other sites

#4 ·  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

Share this post


Link to post
Share on other sites

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.

Share this post


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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

This is what I wanted to add =)

Posted Image

Click to enlarge =)

Edited by BL@(K-R34P3R

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  
Followers 0