Jump to content
Sign in to follow this  
srikanthsurabhi

HotKeySet

Recommended Posts

srikanthsurabhi

Hi All,

I am looking for a script that helps me send strings to an application say PuTTY when I hit Keys like F1,F2 etc

Opt("WinTitleMatchMode",2)

Opt("MustDeclareVars", 1)

WinWaitActive("PuTTY")

HotKeySet("{F1}","alreadyprocessed")

Func alreadyprocessed()

Send("Already Processed")

EndFunc

I tried using above script. It is not working. Please help me.

P.S. I am a newbie to AutoIT.

Thank you,

Srikanth

Share this post


Link to post
Share on other sites
PsaltyDS

Nothing keeps your script running. You need an idle loop like:

While 1
     Sleep(10)
Wend

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
srikanthsurabhi

Thank you it worked ;)

Opt("WinTitleMatchMode",2)

Opt("MustDeclareVars", 1)

WinWaitActive("PuTTY")

HotKeySet("{F1}","alreadyprocessed")

While 1

Sleep(10)

WEnd

Func alreadyprocessed()

; Unset the HotKey

HotKeySet("{F1}")

Sleep(30)

Send("Already Processed")

Sleep(800)

; Reset the HotKey

HotKeySet("{F1}", "alreadyprocessed")

EndFunc

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×