Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Creating hotkey that launches a program and performs a loop and closes it if used again

$
0
0
Hey all! This is probably the most simple request in the forum that will make most of the experienced users go "DUH!"

Being a total noobie I'm still trying to figure things out. Basically wanted to create a hotkey that will launch a program, then run an infinite loop within the program until the hotkey is pressed again.

So far I've made this...and while it launches notepad, it won't enter the A, B, C text. Any tips?

[ autoit ]      
Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") Dim $Hotkey HotKeySet("{F9}","Start") Func Start() $Hotkey = NOT $Hotkey If $Hotkey Then ToolTip('Hotkey was pressed',0,0) While $Hotkey Send("{A}") Send("{B}") Send("{C}") WEnd ToolTip("") EndFunc

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>