Im trying to create a script that will take some text in textbox in browser and run regexReplace on it and then replace the original text with updated text.
Currently my issue is getting the text from the window into the variable inside the script. I tried using Clipboard, but it ever only used the first thing I got in it, it worked only the first time I run the script, eg. I run the script to copy "first" and put it into MsgBox it works, but when I have it copy "second" it shows "first".
I'm asking for help how to get text from textbox in browser so I can edit it.
Here is the code I used to get text into the script:
Code: Select all
clipSaved := ClipboardAll
Clipboard := ""
ClipWait(2, 1)
Send "^a"
Send "^c"
ClipWait(2, 1)
test := A_Clipboard
MsgBox test
Clipboard := ""
Clipboard := clipSaved
ClipWait(2, 1)
Goal is to have a script that removes all text between parenthesis () in a textbox
"This is (an) example" -> "This is example"
im on windows 11 and have clipboard enabled (win+v) and Im using ahk v2