Guest BL@(K-R34P3R Posted October 8, 2004 Share Posted October 8, 2004 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 comment Share on other sites More sharing options...
ezzetabi Posted October 8, 2004 Share Posted October 8, 2004 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 comment Share on other sites More sharing options...
this-is-me Posted October 8, 2004 Share Posted October 8, 2004 He means Javascript, not Java. Javascript runs in the web browser, not in autoit. Who else would I be? Link to comment Share on other sites More sharing options...
ezzetabi Posted October 8, 2004 Share Posted October 8, 2004 (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 October 8, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 8, 2004 Share Posted October 8, 2004 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 comment Share on other sites More sharing options...
ezzetabi Posted October 8, 2004 Share Posted October 8, 2004 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 comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 8, 2004 Share Posted October 8, 2004 Ok, I just got back from school. I'll try it out right now. Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted October 9, 2004 Share Posted October 9, 2004 (edited) This is what I wanted to add =)Click to enlarge =) Edited October 9, 2004 by BL@(K-R34P3R Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now