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
  • Hi ,

    That's another excellent script, thank you for sharing it. I think this forum on auto hotkeys scripts is becoming an excellent place to find the things that translators really need to be able to do in the software without the need for these workarounds. I'd call these bread-and-butter productivity features ;-)

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • 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

Reply
  • 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

Children