GrizDoug Posted December 29, 2008 Posted December 29, 2008 Is there a way to call an AutoHotKey script from an AutoIt script, if the AutoHotKey script has been compiled? I tried googling this as well as looking in the help for both and wasn't able to find anything. Gotta keep on truckin' to find the perfect solution, but sometimes you run into roadblocks, so you gotta jam right through those roadblocks!!
Andreik Posted December 29, 2008 Posted December 29, 2008 Is there a way to call an AutoHotKey script from an AutoIt script, if the AutoHotKey script has been compiled? I tried googling this as well as looking in the help for both and wasn't able to find anything.I don't know how is a AutoHotKey script but if is compiled I think should work Run() or ShellExecute().
Pain Posted December 29, 2008 Posted December 29, 2008 (edited) Isn't AutoHotkey AutoIt v2?If it's compiled you can use Run as with any other exe files. However best would be to translate everything to AutoIt code to be able to control it better.http://www.autoitscript.com/autoit3/docs/faq.htm#3Start \ AutoIt v3 \ Extras \ v2 to v3 converter Edited December 29, 2008 by Pain
system24 Posted December 30, 2008 Posted December 30, 2008 Isn't AutoHotkey AutoIt v2?Not exactly. It's based on AutoIt v2 but has some functions and syntax different from AutoIt v2.@OPRun(). It's compiled as EXE. [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]
GrizDoug Posted December 30, 2008 Author Posted December 30, 2008 I tried with the following code: Run("DevicesSet.exe", "C:\Scripts") It didn't seem to work. Thanks. Gotta keep on truckin' to find the perfect solution, but sometimes you run into roadblocks, so you gotta jam right through those roadblocks!!
igotandrew Posted December 30, 2008 Posted December 30, 2008 I tried with the following code:Run("DevicesSet.exe", "C:\Scripts")It didn't seem to work.Thanks.TryRun("C:\Scripts\DevicesSet.exe")
TurionAltec Posted December 30, 2008 Posted December 30, 2008 And it needn't be compiled. If you have the appropriate file extension associations, you can run it directly with Shellexecute: ShellExecute("C:\Scripts\DevicesSet.ahk") You may have to adjust the path, depending on where the AHK interpreter EXE is.
GrizDoug Posted December 30, 2008 Author Posted December 30, 2008 TryRun("C:\Scripts\DevicesSet.exe")I tried your suggestion and it worked for a single line in the AutoIt one line script.Now I need to integrate it into my main script and see how it does. If it goes well then I'm done for this part, otherwise, back to the drawing board. I'll check it tomorrow and let you know.Thanks a whole lot!! Gotta keep on truckin' to find the perfect solution, but sometimes you run into roadblocks, so you gotta jam right through those roadblocks!!
GrizDoug Posted December 31, 2008 Author Posted December 31, 2008 I tried your suggestion and it worked for a single line in the AutoIt one line script.Now I need to integrate it into my main script and see how it does. If it goes well then I'm done for this part, otherwise, back to the drawing board. I'll check it tomorrow and let you know.Thanks a whole lot!!I integrated the call to the AutoHotkey script (Run("c:\Program Files\Autohotkey\Autohotkey.exe c:\scripts\devicesset.ahk")) into my AutoIt script and it all worked fine. Now I just have two more issues to figure out. How to access the microphone and stereo mix devices in AutoHotkey. I used the MICROPHONE keyword in the SoundSet function call, but it didn't do anything to the microphone volume or mute. I am going to head over to the AutoHotkey forum and see what I can figure out. Gotta keep on truckin' to find the perfect solution, but sometimes you run into roadblocks, so you gotta jam right through those roadblocks!!
GrizDoug Posted January 5, 2009 Author Posted January 5, 2009 I integrated the call to the AutoHotkey script (Run("c:\Program Files\Autohotkey\Autohotkey.exe c:\scripts\devicesset.ahk")) into my AutoIt script and it all worked fine. Now I just have two more issues to figure out. How to access the microphone and stereo mix devices in AutoHotkey. I used the MICROPHONE keyword in the SoundSet function call, but it didn't do anything to the microphone volume or mute. I am going to head over to the AutoHotkey forum and see what I can figure out. I realize this isn't the place to ask this question, but it seems this forum might have a better idea about the AutoIt and AutoHotkey scripting methodologies integrating together. If anyone in this forum has any idea on how to use the SoundSet() function from AutoHotkey to set the volume and mute for the Realtek HD Audio microphones and stereo mix in a Vista system, please let me know. Here is my code for the microphone from the AutoHotkey script. SoundSet, 0,MICROPHONE,MUTE,1 SoundSet, 100,MICROPHONE,VOLUME,1 SoundSet, 0,MICROPHONE:2,MUTE,1 SoundSet, 100,MICROPHONE:2,VOLUME,1 I appreciate any assistance and thanks in advance. Gotta keep on truckin' to find the perfect solution, but sometimes you run into roadblocks, so you gotta jam right through those roadblocks!!
ProgAndy Posted January 5, 2009 Posted January 5, 2009 In this forum you can get help for AU3 functions, but not for AHK. The syntax and possible parameters are really different.Possibly, you find those UDFs useful:http://www.autoitscript.com/forum/index.ph...mp;#entry409587or http://www.autoitscript.com/forum/index.ph...mp;#entry264605 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
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