Wrong value sent

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
apa006
Posts: 1
Joined: 15 May 2024, 05:04

Wrong value sent

Post by apa006 » 15 May 2024, 05:10

Good day,
have created an AHK file that in its code includes following lines:

Code: Select all

ControlFocus, Edit2, Product ahk_class #32770
Sleep, 450 
Send Athens, Greece
Sleep, 400 ;hold for 0.3 sec 
Send {Enter}
Sleep, 450 ;hold for 0.3 sec 
StringReplace, earlyeta , earlyeta , `r`n , , All
ControlSend, Edit10, %earlyeta%, Product ahk_class #32770
Whenever the ahk runs in my computer it behaves properly and works as expected. However, when other users with different regional settings are running the same file in the Edit2 field instead of "Athens, Greece" they get value "Athens, Greece" and then immediately there is addition of the string '04' in front of the word Athens.

Could someone assist and advise why this is happening and how i can overcome that?

Thanks in advance!
best regards, apa006

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
[Mod edit: Moved topic from AHK v2 help since this is v1 code.]
Rohwedder
Posts: 7732
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Wrong value sent

Post by Rohwedder » 15 May 2024, 09:52

Hallo,
I have no idea how this '04' is created, but try replacing

Code: Select all

Send Athens, Greece
with

Code: Select all

Send {Text}Athens, Greece
User avatar
CoffeeChaton
Posts: 35
Joined: 11 May 2024, 10:50

Re: Wrong value sent

Post by CoffeeChaton » 15 May 2024, 10:15

1. did you check other pc has ahk_class #32770 and Edit2?
2. try it to replace Send Athens, Greece

Code: Select all

_Clipboard := Clipboard
Clipboard := "Athens, Greece"
Sleep, 10
Send, {Control down}
Sleep, 10
Send, v
Sleep, 10
Send, {Control up}
Sleep, 10
Clipboard := _Clipboard
Post Reply

Return to “Ask for Help (v1)”