Hello members of the autohotkey community, I want to create code to help me work.
I want to create a code that will replace the number layout.
for example, the code is as follows (Codes are random at all times):
00 00 0 000 000, 00000000000, 0 000 000, 0000000
i want this code changed to:
00 00 0 000 000
00000000000
0 000 000
0000000
And a system that can see and read this code will change.
code that will replace the number layout
Re: code that will replace the number layout
Code: Select all
Code := "00 00 0 000 000, 00000000000, 0 000 000, 0000000"
Msgbox % RegExReplace(Code, ",( +)?", "`n")
Re: code that will replace the number layout
Smile_ wrote: ↑21 Oct 2021, 14:44Code: Select all
Code := "00 00 0 000 000, 00000000000, 0 000 000, 0000000" Msgbox % RegExReplace(Code, ",( +)?", "`n")
I want to make my random code "00 00 0 000 000, 00000000000, 0 000 000, 0000000" read on notpad and automatically converted to normal number layout.
I write to notepad the code "00 00 0 000 000, 00000000000, 0 000 000, 0000000" I click "Numpad2" and my script automatically writes the following code:
00 00 0 000 000
00000000000
0 000 000
0000000
I want the neat code to be on the notepad as well and I can copy it
Re: code that will replace the number layout
Make a selection first.
Code: Select all
Numpad2::
If WinActive("ahk_exe notepad.exe") {
Clipboard := ""
SendInput, ^c
ClipWait, 1
If (!Clipboard)
MsgBox, 64,, % "There is nothing to do in here!"
SendInput, % "{Raw}" RegExReplace(Clipboard, ",( +)?", "`n")
}
Return
Esc::ExitApp
Re: code that will replace the number layout
Smile_ wrote: ↑22 Oct 2021, 11:32Make a selection first.Code: Select all
Numpad2:: If WinActive("ahk_exe notepad.exe") { Clipboard := "" SendInput, ^c ClipWait, 1 If (!Clipboard) MsgBox, 64,, % "There is nothing to do in here!" SendInput, % "{Raw}" RegExReplace(Clipboard, ",( +)?", "`n") } Return Esc::ExitApp
is it possible to make it work like this?
Re: code that will replace the number layout
Isn't that what the last script meant to do?
You want to add text instead of replacing?
You want to add text instead of replacing?
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: code that will replace the number layout
Correct and incorrect are not opinions. Their script does work as you asked. What is it that you have an issue with?
Re: code that will replace the number layout
Try this:
Russ
Code: Select all
Numpad2::
If WinActive("ahk_exe notepad.exe") {
Clipboard := ""
SendInput, ^a
SendInput, ^c
ClipWait, 1
If (!Clipboard)
MsgBox, 64,, % "There is nothing to do in here!"
SendInput, {Esc}{End}{Enter 2}
SendInput, % "{Raw}" RegExReplace(Clipboard, ",( +)?", "`n")
}
Return
F1::ExitApp
Who is online
Users browsing this forum: slishnevsky and 92 guests