Replace All without Find Next first

Here's the script:

 

;------------------------------------------------------------------------------
;Replace All that no longer requires "Find Next" first
;------------------------------------------------------------------------------
~LButton::
ifWinActive Find and Replace
{
MouseGetPos,,,,Ctrl ; gets the ClassNN of the control under the cursor

if (Ctrl = "WindowsForms10.BUTTON.app.0.29531c8_r9_ad19")

{

Controlclick, Find &Next, Find and Replace
Sleep 1000
Controlclick, R&eplace All, Find and Replace

}
}
Return

 

And I've written about it here: Replace All that Really Means Replace All.

Parents Reply Children
  • Thank you Paul! I agree that this forum is an excellent resource.  Just last week I had a project that required a lot of segment merging, so I made extensive use of the script you shared for that.

    Here's another script I've recently added to the one above for Replace All. This runs the Replace All operation when pressing Enter, then returns the cursor to the first unconfirmed segment in the document.

    ;––––––––––––––––––––––––––––––––––––––––––––––

    ;Use Enter to Replace All

    ;–––––––––––––––––-––––––––––––––––––––––––––––

    #IfWinActive, Find and Replace

    Enter::

    Controlclick, Find &Next, Find and Replace

    Sleep 1000

    Controlclick, R&eplace All, Find and Replace

    Return

    Esc::      ;After the Replace All operation is complete, press Escape

    Controlclick, &Close, Find and Replace

    Sleep 200

    Send {Control Down}{Home}{Control Up}{Down}{Control Down}{Enter}{Control Up}    ;after closing the dialog, go back to first unconfirmed segment, this assumes that Ctrl+Enter is the Confirm segment shorcut; if different, update accordingly

    Return

    #IfWinActive

  • Silvia Cavicchio said:
    It is getting even better! Thank you, Nora.
     

     

    Thank you Silvia! Glad you find it useful. ; )