Jump to content

Recommended Posts

Posted

Hi,

I have a text file which is already open in notepad.

I wish to simulate a CTRL+h -- Find Replace keystrokes.

How can I do this ??

I tried some combination as below, but none worked!!

send ("{LCTRL+H}")

send ("{LCTRL}+{H}")

I guess I am missing something here....

Please advice.

Thx

Vai

Posted

You could also use AutoIt to perform the find replace, but either opening the file in AutoIt, or getting the text from the notepad window, performing a StringReplace/StringRegExpReplace, and then clearing notepad and adding the modified text.

Cheers,

Brett

Posted

  vaibhavs said:

Hi,

I have a text file which is already open in notepad.

I wish to simulate a CTRL+h -- Find Replace keystrokes.

How can I do this ??

I tried some combination as below, but none worked!!

send ("{LCTRL+H}")

send ("{LCTRL}+{H}")

I guess I am missing something here....

Please advice.

Thx

Vai

Another example

Run("notepad.exe")
WinWait("[CLASS:Notepad]")
WinActivate("[CLASS:Notepad]")

send(" aa bb {ENTER} cc aabbcc")

$sFind = "aa"
$sReplacewith = "bb"
  
Sleep(3000); 3 sec to look at text

;Send("!er" &$sFind & "{TAB}" & $sReplacewith & "!a{ESC}")
; or
Send("^h" &$sFind & "{TAB}" & $sReplacewith & "!a{ESC}")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...