1
N.A.N.Y. 2022 / Re: NANY 2022 Entry -- WayText
« on: May 17, 2022, 02:20 PM »
I found an annoying bug... Mostly I use the tool for typing text narratives into webforms. The quickest way to do this is with
It works fine like that, but recently I happened to end up with a setup such as
WayText has to use the Windows clipboard to do those paste commands. It does them by simulating "Ctrl+V" key presses. The app also will save your original clipboard contents and put them back on the clipboard after doing the paste commands. What I found was that -- when a typed-out string was followed by pastes -- the AutoHotkey engine would quickly reset the clipboard and then restore the original content before Windows' keyboard buffer could catch up. The result was
The solution -- until I can come up with something less kludgy -- is to add a dynamic pause after the text is played. The length of pause is dynamic because it's generated from the length of the text string. This dynamic pause (actually a "Sleep" command) only is applied if an entry contains both 'paste' and 'type' components. This is not a perfect system, as some apps (looking at you Chrome) accept the typing more slowly than others. If a text sting is no more than 600 characters or so, then the current delay should work. The current post-type delay is 200 milisecs + (strLength * 2).
Updated version (v5-17-2022) is in top post. Note that the Settings tool is also updated. It has a checkbox to use/don't use post-type delay.
Code: Text [Select]
- Paste a segment of text.
- Type out {Tab}{Tab}
- Paste another segment of text.
- Type out {Tab}{Tab}
- Etc.
It works fine like that, but recently I happened to end up with a setup such as
Code: Text [Select]
- TYPE a segment of text.
- Type out {Tab}{Tab}
- Paste a segment of text.
- Type out {Tab}{Tab}
- Etc.
WayText has to use the Windows clipboard to do those paste commands. It does them by simulating "Ctrl+V" key presses. The app also will save your original clipboard contents and put them back on the clipboard after doing the paste commands. What I found was that -- when a typed-out string was followed by pastes -- the AutoHotkey engine would quickly reset the clipboard and then restore the original content before Windows' keyboard buffer could catch up. The result was
Code: Text [Select]
- TYPE a segment of text.
- Type out {Tab}{Tab}
- Erroneously Paste your original clipboard content, rather than the other segment of text.
- Type out {Tab}{Tab}
- Etc.
The solution -- until I can come up with something less kludgy -- is to add a dynamic pause after the text is played. The length of pause is dynamic because it's generated from the length of the text string. This dynamic pause (actually a "Sleep" command) only is applied if an entry contains both 'paste' and 'type' components. This is not a perfect system, as some apps (looking at you Chrome) accept the typing more slowly than others. If a text sting is no more than 600 characters or so, then the current delay should work. The current post-type delay is 200 milisecs + (strLength * 2).
Updated version (v5-17-2022) is in top post. Note that the Settings tool is also updated. It has a checkbox to use/don't use post-type delay.