leuce Posted June 21, 2017 Share Posted June 21, 2017 G'day everyone I'm trying to write a script to type special characters (e.g. non-breaking space, en dash, etc) via shortcuts. When I test the Unicode characters using e.g. Send ("{ASC 0160}"), it sends the correct character, but when I try to use this in a script with hotkeys, the hotkeys do not cause anything to be sent. HotKeySet("+^{SPACE}", "nonbreakspace") HotKeySet("^{NUMPADSUB}", "endash") HotKeySet("^-", "hyphdash") HotKeySet("!^.", "ellips") While 1 Sleep(100) WEnd Func nonbreakspace() Send ("{ASC 0160}") EndFunc Func endash() Send ("{ASC 0150}") EndFunc Func hyphdash() Send ("{ASC 0150}") EndFunc Func ellips() Send ("{ASC 0133}") EndFunc Can anyone see what I'm doing wrong here, or does Send {ASC} simply not work with hotkeys? Thanks Samuel Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 21, 2017 Moderators Share Posted June 21, 2017 @leuce I believe you are hitting an issue with Send trying to operate before your hotkeys have finished fully. This works just fine for me; you'll have to find the sweet spot: HotKeySet("^-", "Test") while 1 sleep(100) WEnd Func Test() Sleep(500) Send("{ASC 0150}") EndFunc Xandy 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now