nexguy Posted March 31, 2008 Share Posted March 31, 2008 I must have searched through this entire site and I cannot find anything about this. I used to do it with AutoHotkey, but my new company uses AutoIt. It looks great! But how can I execute a script with a hotkey...like "windows"+"z" or something? Or maybe I missed it and I am blind? Thank you! Link to comment Share on other sites More sharing options...
someone Posted March 31, 2008 Share Posted March 31, 2008 (edited) Ha I'm not gonna call you blind... Check out HotKeySet () in the help file, and _IsPressed() Welcome to the forum Edited March 31, 2008 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
Swift Posted March 31, 2008 Share Posted March 31, 2008 (edited) Try This: #InCludE <MiSC.aU3> While 1 If _IsPressed("01") Then ExecuteScript() Sleep(50) WEnd Func ExecuteScript() ;do your script here! EndFunc Edited March 31, 2008 by R6V2 Link to comment Share on other sites More sharing options...
nexguy Posted March 31, 2008 Author Share Posted March 31, 2008 Ah, so I have to create a key catching script that runs all the time, to catch my hotkey presses? Link to comment Share on other sites More sharing options...
Swift Posted March 31, 2008 Share Posted March 31, 2008 (edited) Ah, so I have to create a key catching script that runs all the time, to catch my hotkey presses?Try what I did, set it in a loop, until it is pressed, maybe try this: #include <misc.au3> Do Sleep(50) Until _IsPressed("01") ;do your code here. Edited March 31, 2008 by R6V2 Link to comment Share on other sites More sharing options...
nexguy Posted March 31, 2008 Author Share Posted March 31, 2008 This would be for all day use. For example, I have a user that wants to be able to press a button and it types her e-mail address. Or it runs a quick test script for her. Link to comment Share on other sites More sharing options...
someone Posted March 31, 2008 Share Posted March 31, 2008 (edited) There are differences between IsPressed and Hotkeyset, and I would suggest trying out Hotkeyset... it sounds more like what you need. But either way, you need to tell your script to do something while 'listening' for a certain keypress, aka a loop. The example in the help file for Hotkeyset uses a While/Wend loop, which will keep the script alive and listening until the user kills it. Edited March 31, 2008 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
monoceres Posted March 31, 2008 Share Posted March 31, 2008 Or you make a shortcut to the script at the desktop and assign a hotkey to it by right clicking and choosing properties Broken link? PM me and I'll send you the file! 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