moose 0 Posted April 22, 2011 Hi, I'm trying to create a keyboard macro that will send text to an editor when a key combination is pressed (alt+a). Whenever I press alt+a, I get an error beep, and the first letter of the macro text is missing. Thanks in advance. Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0) ; Set the HotKeys HotKeySet("!a", "_align") HotKeySet("{ESC}", "On_Exit") ; Now keep the script active While 1 Sleep(10) WEnd Func _align() ; Unset the HotKey HotKeySet("!a") ; Send the keys Send("hello") ; Reset the HotKey HotKeySet("!a", "_align") EndFunc Result when alt+a is pressed: ello Share this post Link to post Share on other sites
Jos 2,214 Posted April 22, 2011 Works fine here with SciTE after completing the posted script so it runs. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
moose 0 Posted April 22, 2011 (edited) I don't use Scite. Broken in Notepad++ and Notepad here (Windows XP) Interestingly, if I hold alt down, and continue to press 'a' 'a' 'a', the first one is broken, but subsequent ones work ok. =\ Edited April 22, 2011 by moose Share this post Link to post Share on other sites
Jos 2,214 Posted April 22, 2011 Try adding a sleep(200) before the Send() to allow for the release of Alt ... else you simulate ALT+(the send characters) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites