Jump to content

Recommended Posts

Posted

Got a new HP WIN7 box so tried a new script language (AutoHotKey). Played with it for a few days and wrote a startup script to assign some hotkeys. But tired of the syntax and then found AutoIT. Rewrote the startup script for AutoIT and it worked, mostly. One hotkey (Ctrl-Alt-s) was already assigned to an HP msgbox displaying system info. AutoHotKey replaced that assignment with mine but AutoIT doesn't seem to be able to unless I'm missing something.

Any help greatly appreciated if it can be done in AutoIT.

Sample of both scripts:

;
;   AutoIT sample
;
#NoTrayIcon
HotkeySet("^!s", "Scout")   ;# Scout            Ctrl-Alt-s
.
.
.
While 1
    Sleep(10000)
WEnd
.
.
.
Func  Scout()
    Send ("Hello World")
EndFunc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

AutoHotKey Sample

#persistent
#notrayicon
#SingleInstance ignore
.
.

^!s::
Send Hello World
Return
.
.
Posted

Bruce,

Thanks for the quick reply but the While loop delay is not the answer. The loop serves as the script's "heartbeat" to keep it alive and thereby keep the Hotkey assignments in effect. Once they have been established, the system reacts effectively immediately to their being pressed.

And I saw no reason to waste CPU cycles needlessly. You can set it to 7200 but you won't have to wait 2 hrs to get a hotkey response. Try it.

Posted

I'm aware what the While loop delay is for, and what it does. I was just thinking that maybe 10 seconds was too long of a Sleep delay. How do you get two hours out of 7200 ms? That's less than 7 1/2 seconds.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...