I wish to paste Unicode characters into *any* application. (Of course, one gets strange results if the application is not Unicode-compliant.) I finally got the transform method to work (intermittently) with the following code snippets:
!a:: ; {asc 0256} Alt a - simple long-a (amacron)
UTF8 := chr(0xc4) . chr(0x81)
gosub PostKey
return
UTF8 := chr(0xc4) . chr(0x81)
gosub PostKey
return
^!s:: ; {asc 7779} Ctl-alt s - simple dot under s (sdotbelow)
UTF8 := chr(0xE1) . chr(0xB9) . chr(0xA3)
gosub PostKey
return
UTF8 := chr(0xE1) . chr(0xB9) . chr(0xA3)
gosub PostKey
return
;========= subroutine ==========
PostKey:
Transform, Clipboard, Unicode, %UTF8%
send, ^v
return
In Word 97 when I type Alt-a I get the amacron character. But if I type Alt-a twice in a row, I get a {space} before subsequent amacron. I get the space when any two Unicode characters are typed side by side. Repeated presses soon produce the “out of memory or disk space” error. In Word itself, repeatedly pressing ^v pastes the Unicode character properly with no problems.
When I type Ctrl-alt-s in Word and OOo writer, I get *two* sdotbelow characters! (This only happens with sdotbelow!) If I press^v afterwards I get a single sdotbelow.
When I add the line Clipboard :="" before the transform statement, I get a single sdotbelow characters in word, but still get two of them in OOo. And Word still produces the memory error after repeated keystrokes.
Putting a Sleep, 50 or Sleep, 100 statements here and there doesn’t seem to make any appreciable difference. Except for making things worse, somehow. Same with using the “clipsaved” code you suggested on the “Clipboard, ClipboardAll, and OnClipboardChange” help pages. Which is why I settled on the simplest code, as in the snippets above.
Perhaps there is a postmessage command that causes a paste in the receiving program? However, I tried
PostMessage, 0x302 —— gives errorlevel=1 in both apps, and nothing happens
PostMessage, 0x302, 0 —— gives errorlevel = 1 in OOo only, but nothing happens in either app.
PostMessage, 0x302, 0 —— gives errorlevel = 1 in OOo only, but nothing happens in either app.
Thank you for the help.
-Sadhu