unwanted scrambling of text strings

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

unwanted scrambling of text strings

02 Dec 2021, 13:55

Recently a text string has been scrambled - [email protected] is rendered as [email protected] That is the simplest example, another longer string has also not been rendered accurately. I've just noticed that it depends on where the string is pasted. Accurate in this thread and in Notepad, but scrambled in a different 'destination'. Is there a remedy ?
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: unwanted scrambling of text strings

02 Dec 2021, 13:58

Like you said, it usually depends on the target application. There is no general solution, but you could try {text} mode.

Code: Select all

Sendinput {text}[email protected]
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 03:33

The code I have been using was

Send [email protected]

if I change that to

Send {text}[email protected]

it still pastes [email protected] into Notepad,
but where the text was scrambled, it remains blank (totally disabled).
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: unwanted scrambling of text strings

04 Dec 2021, 03:43

You can try different send modes and key delays.
Like said, it often depends on the target application - if you tell us what it is, some people might be able to help you testing. Otherwise, people can just give generalized advice.

Also, you could mention your AHK and Windows versions.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 03:50

The one application in which it NOW (not previously) fails (there may be others that I do not now remember) is 'Wordperfect 5.1+ for DOS' in x32Win10ProV21H1 using Autohotkey v1.1.33.01

Key delay is a concept I am familiar with - how would I apply that to 'send [email protected]' ?
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: unwanted scrambling of text strings

04 Dec 2021, 04:53

Try this:

Code: Select all

Clipboard := "[email protected]"
Send, ^v
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 05:38

Your code is so much more complex than what I have shown you I use, that I can not see how to apply yours.

My 'boilerplate.ahk' is a list covering most letters of the alphabet (plus 'characters') with left-win key and then with right-win key.

Only very few would ever be pasted into WordPerfect (where the scrambling is likely to happen).
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: unwanted scrambling of text strings

04 Dec 2021, 08:22

Jose-phil wrote: Your code is so much more complex than what I have shown you I use, that I can not see how to apply yours.
:?: :?: :?:

Are you referring to the following two lines as “so much more complex”…

Code: Select all

Clipboard := "[email protected]"
Send, ^v
…as compared to the following?
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 08:42

It sounds like a longer script is being used, but it is not posted here. Seeing the script may help readers debug it.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 12:58

My script has 60 to 70 lines, all variants of

<#3:: Send [email protected]

where '3' is any letter, digit or character
and '[email protected]' is whatever text string interests me.

There is NO

Code: Select all - Toggle Line Numbers,
Clipboard : =
or 'v

I cant see where or how to introduce those 'new terms', that is what makes it complex for me.
AND the suggested addition of

{text}

is missing.

Only now do I realise that

SendInput

also differs from my

send

and again, I don't know what how to implement that change.


A further difficulty is that while writing a reply, the previous posts are invisible, so the way this forum operates also takes me by surprise.
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 13:15

gregster suggested

Code: Select all

Sendinput {text}[email protected]
but you did not indicate whether you tried this script.

Testing this would be easy, fast, and informative. If it does not work, you can try running your script as admin.
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: unwanted scrambling of text strings

04 Dec 2021, 13:26

Jose-phil wrote: There is NO

Code: Select all - Toggle Line Numbers,
You are mistaking the headers of the code box as part of the script. Your script has:
Send [email protected]

and I suggested replacing it with:
Clipboard := "[email protected]"
Send, ^v
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 13:42

I made the substitution you suggested, and now nothing gets pasted.
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: unwanted scrambling of text strings

04 Dec 2021, 13:50

How did you do it?

If you made it like this:
<#3::Clipboard := "[email protected]"
Send, ^v

….then nothing would get pasted because that’s a single-line hotkey that ends after executing the first line. It would need to be a multi-line hotkey definition, like this:
<#3::
Clipboard := "[email protected]"
Send, ^v
return
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 13:53

Jose-phil: please post a short test script that you are trying to get working. This will ease the debugging process. It's better than "I made the changes..." Will lead to a faster solution.
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 17:45

Boiler - you 'guessed' correctly I did do as your first pic shows, but doing it as the second pic shows, produces a reaction that is totally inappropriate and unuseful in Word perfect (where I detected the problem).

Mikeyww
I dont know what else I can give/show you.
I have already written that my code is 60-70 repetitions of
<#3:: Send [email protected]
where the '3' can be any letter or digit or character, and the '[email protected]' is whatever text string I want.
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 19:15

As a first step, I would try the following script alone with no other code. Don't retype it; just paste it the way it is.

Code: Select all

F3::SendInput {Text}[email protected]
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 19:28

That substitution resulted in NO response, both for the 'left-win-3' hotkey that I was using and for F3
User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: unwanted scrambling of text strings

04 Dec 2021, 19:37

If that is the entire script, and you have run the script and see the green icon in your system tray, then there are only a few possibilities, I think.

1. Antivirus killed it
2. Your active target window will not accept text
3. Conflicting software (hooks, keyboard shortcuts, keyboard & mouse utilities, etc.)
4. Some kind of admin rights issue

Perhaps there are one or two others. You mentioned that you are using Wordperfect 5.1+ for DOS. I have not tested this in DOS. Possibly helpful: https://www.autohotkey.com/board/topic/12456-autohotkey-in-dos/
Jose-phil
Posts: 45
Joined: 19 Apr 2020, 06:17

Re: unwanted scrambling of text strings

04 Dec 2021, 20:19

I've had a look at the URL you provided. Yes it refers to DOS. My Wordperfect for DOS works (through TAME ?) in the latest Windows 10. I could not find any useful clues. By the way, the corruption has increased instead of 'com' being changed to 'ocm', now an 'l' gets inserted, so its 'olcm'.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy, scriptor2016 and 358 guests