vaibhavs Posted January 13, 2009 Posted January 13, 2009 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
Pain Posted January 13, 2009 Posted January 13, 2009 (edited) Send("^h") Edited January 13, 2009 by Pain
azure Posted January 13, 2009 Posted January 13, 2009 Run("notepad.exe") WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") SLEEP(100) SEND("^h") SEND("TEST") SEND("{ENTER}")
KaFu Posted January 13, 2009 Posted January 13, 2009 Send("^h") OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
vaibhavs Posted January 13, 2009 Author Posted January 13, 2009 oh yes, Its worked great!! Thx a ton for your help regards, Vai
LeHuynhNam Posted January 14, 2009 Posted January 14, 2009 Pain said: Send("^h")another waySend("!er")
BrettF Posted January 14, 2009 Posted January 14, 2009 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Malkey Posted January 14, 2009 Posted January 14, 2009 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 VaiAnother 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}")
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now