unwanted scrambling of text strings

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 20:41

OK. I don't have that WP! Gregster mentioned trying a key delay, so it could be worth a go.

Code: Select all

F3::
SetKeyDelay, 25
Send {Text}[email protected]
Return
If you still get scrambling, it could be interesting to see what happens if you increase that key delay to 100.

There are some Web sites where I also need to use a key delay like this, about 25.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

02 Oct 2023, 08:17

I have only just seen your reply - 2 years late - and will try it and report back.

My AHK has many single line entries of the following format
<#6:: Send Joe

I can not see how I can incorporate a delay into that - can you please help me ?
User avatar
andymbody
Posts: 902
Joined: 02 Jul 2017, 23:47

Re: unwanted scrambling of text strings

02 Oct 2023, 10:28

Jose-phil wrote:
02 Oct 2023, 08:17
I can not see how I can incorporate a delay
2 years... sounds like delay is a talent that should come naturally...
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

02 Oct 2023, 10:55

Code: Select all

#Requires AutoHotkey v1.1.33
SetKeyDelay 25
; SendMode Event
F3::Send {Text}[email protected]
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

02 Oct 2023, 12:52

Andymbody - I do appreciate the humour of the unflattering joke.

Mikeyww - I've managed (by sheer luck) to extract that My Autohotkeys appears to be v1.1.33.01 - so I have got to first base, and will have to see how I can implement your code. I've not touched in innards of Autohotkeys for years.
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

02 Oct 2023, 14:04

You might want to start just by running the script that I posted. If it works, you can expand it.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

02 Oct 2023, 17:55

If I find that the following code in AHK :

<#\:: Send This text is quite likely to be scrambled when pasted into WordPerfect

is a self-fulfilling prophecy, how do I alter it to increase the delay ?
Is it possible to modify that line to ensure that it is a false prediction ? If so HOW ?
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

02 Oct 2023, 20:32

When you ran the script that I posted, what happened? What was the output?
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

02 Oct 2023, 21:02

I had not run it because I am not familiar with the conventions. When you write 'script' do you mean

SetKeyDelay 25
; SendMode Event
F3::Send {Text}[email protected]

?

As I have said several times before, my AHK is a series of lines of the format

<#6:: Send Joe

I can not see how to combine your 3-line script with that.
It is SOME of those entries that 'need' the delay
but off-hand I can not say which.
There is ONE long text which I KNOW gets scrambled in WordPerfect.
There may be others.

Or do you mean that I should make another AHK with your script,
and run it simultaneously with my 80-line AHK ?
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

02 Oct 2023, 21:15

What I would try:
Close your entire script. That's the whole file.
Run my script file. Copy and paste the code.
Trigger the hotkey.
See what happens. It's a test.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

02 Oct 2023, 21:26

I experimented to find a hotkey that gets scrambled in WordPerfect.

I copied your three lines into Notepad and saved it on the desktop as test.ahk

I double clicked it; then ran the hotkey that produces hash in Wordperfect.
A different version of hash appeared.
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

03 Oct 2023, 06:25

I do not know what that means, but if your script conflicts with hotkeys that your program is already using, you might get unexpected results. Why not test the hotkey that is in the script?
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

03 Oct 2023, 15:43

Double clicking 'your' AHK disables F3 in WordPerfect.
There is no other noticeable effect from pressing F3 in or outside of WordPerfect.
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

03 Oct 2023, 16:43

You could change the hotkey. The point of the script is to test whether increasing the key delay resolves the problem.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Oct 2023, 00:45

When I substituted a prededicated letter for F3, the result with the leftwin key was the addition of '[email protected]' to the prededicated text; with the rightwin key, there was no change.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Oct 2023, 02:38

Your method is slowly starting to dawn on me, so

I deleted the troublesome key out of 'my' AHK and substituted its key and its text into 'your' AHK.

With the leftwin key, there was no effect in Wordperfect, with the rightwin key it gave the expected result - the non-troublesome text got pasted.
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Oct 2023, 05:36

I cannot determine what this means or even whether your script worked. If your revised script does not work, post it in a new reply, indicate specifically what you did, what the script did, and what the script should do instead.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Oct 2023, 06:31

I know now that I can simply NOT LAUNCH 'my' original AHK, and just run yours. That simplifies the testing.

To establish a base line, I ran my original hotkey in WordPerfect for "Your name does NOT show in the list of available TV partners" for the leftwinkey.
and what got pasted into Notepad was "Your name does NOT show in the list of available TV partners"
but into WordPerfect : "Your name does NT ho nthe lit oaaiab1e T artnesOswi s vllVpr"; the first three words fluently, the rest hesitatingly.

So I killed that AHK and in Notepad ran the AHK that contains

SetKeyDelay 25
; SendMode Event
\::Send {Text}Your name does NOT show in the list of available TV partners

Nothing happened, likewise in Wordperfect, nothing happened.
User avatar
mikeyww
Posts: 26936
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Oct 2023, 06:34

I tested your last script in Notepad. It worked there, so something else must be happening.

Why send might fail
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Oct 2023, 07:02

One obvious conclusion is that my original code succeeds in sending - even if erroneously, whereas your code does not succeed.

That is an impressive list of possible faults your URL refers me to.

That neither of our codes are perfect in WordPerfect is interesting, but understandable - WordPerfect is a DOS program - precedes Windows.

That your code works in your Notepad, but not in mine, is intriguing and should be of greater interest to you than the failure in WordPerfect.

Your kind help has made me re-evaluate my NEED for AHK success in WordPerfect and made me consider potential workarounds.

And for me - I am satisfied with Autohotkeys' performance in other programs, so if the delay function is needed, it is only in WordPerfect (which could be an additional explanation for why I let the matter rest for 2 years), and I may be able to deal with that in a different way.

I am willing to leave it at this, but should you want to investigate the Notepad issue, I'll cooperate as best I can.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: -Elaphe-, downstairs, Frogrammer and 278 guests