mark2004 0 Posted June 2, 2004 I would like to be able to attach a hotkey to a particular script so that pressing the key executes the script. I read over the info for the "HotKeySet" function but this assigns a hotkey to a function within a given script. I want the hotkey to run the entire script. Any ideas?? Mark Share this post Link to post Share on other sites
pekster 0 Posted June 2, 2004 Sure, use this to start your script. It will basically wait for the keypress, and then start the function Main(). HotKeySet("!a", "Main") ;wait for ALT-a keystroke, then go to Main() While 1 ;loop forever to wait for the keypress Sleep(100) ;no need to kill the CPU WEnd Func Main() HotKeySet("!a") ;remove the hotkey so we don't jump around once we have started ;you start your script here EndFunc [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Share this post Link to post Share on other sites
mark2004 0 Posted June 2, 2004 well, I'd prefer not to have a script running continuously in the background. Also, I would like the hotkey to be available at all times from anywhere within the operating system.... picky bastard aren't I...... Share this post Link to post Share on other sites
pekster 0 Posted June 2, 2004 well, I'd prefer not to have a script running continuously in the background.If the script stops, any hotkeys assigned from within that script will no longer work. You need the script to be active if you want to use the hotkey. Having it running isn't hard on the CPU at all because it's waiting 100 ms before it loops. You can increase this number to be even eaisier on the CPU if you'd like.Also, I would like the hotkey to be available at all times from anywhere within the operating systemThat's the way a hotkey works [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Share this post Link to post Share on other sites
Valik 478 Posted June 2, 2004 Create a shortcut to the script, right click the shortcut, have a look at the properties. I'm sure you can see the pertinent option from there. Share this post Link to post Share on other sites
mark2004 0 Posted June 2, 2004 thanks. that's what I was hoping was possible. Share this post Link to post Share on other sites
CyberSlug 6 Posted June 2, 2004 thanks. that's what I was hoping was possible.The shortcut hotkey might only work if the shortcut is on the desktop or StartMenu (and maybe quick launch toolbar). Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites