Guest BL@(K-R34P3R Posted October 8, 2004 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.
ezzetabi Posted October 8, 2004 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.
this-is-me Posted October 8, 2004 Posted October 8, 2004 He means Javascript, not Java. Javascript runs in the web browser, not in autoit. Who else would I be?
ezzetabi Posted October 8, 2004 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
Guest BL@(K-R34P3R Posted October 8, 2004 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.
ezzetabi Posted October 8, 2004 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.
Guest BL@(K-R34P3R Posted October 8, 2004 Posted October 8, 2004 Ok, I just got back from school. I'll try it out right now.
Guest BL@(K-R34P3R Posted October 9, 2004 Posted October 9, 2004 (edited) This is what I wanted to add =)Click to enlarge =) Edited October 9, 2004 by BL@(K-R34P3R
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