Jump to content
Sign in to follow this  
vaibhavs

Notepad : Send : CTRL+H : Find-Replace

Recommended Posts

vaibhavs

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

Share this post


Link to post
Share on other sites
Pain

Send("^h")

Edited by Pain

Share this post


Link to post
Share on other sites
KaFu
vaibhavs

oh yes, Its worked great!!

Thx a ton for your help

regards,

Vai

Share this post


Link to post
Share on other sites
BrettF

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

Share this post


Link to post
Share on other sites
Malkey

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}")

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×