replace character in window
-
- Posts: 2
- Joined: 20 Sep 2017, 13:53
replace character in window
Sorry if this seems painfully simple, but I need a script that changes / to - in the active window. The program software that it's for already contains something that changes the - to / and the programmers can't be bothered to fix it. So something that automatically does it based on window title might not be the best option without a timer. Other option is using a keyboard key to activate it. I'm just having trouble with the activation of the StringReplace function and how it actually fits in with the rest of the script... Can anyone please help?
- divanebaba
- Posts: 805
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: replace character in window
Hi.
The helpfile showsYou have to change to this:Note, that you have to copy your text into the variable called InputVar.
BTW - posting your script could generate more sensible support.
The helpfile shows
Code: Select all
StringReplace, OutputVar, InputVar, SearchText [, ReplaceText, ReplaceAll?]
Code: Select all
StringReplace, OutputVar, InputVar, /, -, A
BTW - posting your script could generate more sensible support.
Einfach nur ein toller Typ.
-
- Posts: 2
- Joined: 20 Sep 2017, 13:53
Re: replace character in window
I have no script really... I just want to press a key like an F key or something and replace / with - in the open program window. But not sure how to start.
Re: replace character in window
Hallo,
try this at your own risk! Hotkey: Control + Minus
try this at your own risk! Hotkey: Control + Minus
Code: Select all
GroupAdd, Better_Not, ahk_class CabinetWClass
GroupAdd, Better_Not, ahk_class ExploreWClass
GroupAdd, Better_Not, ahk_class Progman
GroupAdd, Better_Not, ahk_class WorkerW
#IfWinNotActive, ahk_group Better_Not
^-:: ;Hotkey: Control + Minus
^NumpadSub::
ClipOld := ClipboardAll
Clipboard =
SendInput, ^a
Sleep, 100
SendInput, ^c
ClipWait, 1
IF !Errorlevel
{
StringReplace, Clipboard, Clipboard, /, -, A
SendInput, ^v
Sleep, 100
}
Clipboard := ClipOld
Return
Who is online
Users browsing this forum: doodles333, mikeyww, sanmaodo and 255 guests