This script will take the user back to the segment where the Replace operation was initiated, instead of to the last segment where the Replace operation was executed, which is Studio's default behavior.
The script works by inserting some placeholder text ("markerhere") in the original segment to be found and deleted at the end of the Replace operation.
Hotkeys to run the script:
Ctrl+H - Adds "markerhere" to the active segment. Opens the Replace window. If some text is selected, it will be pasted into the "Find what" field in the Find and Replace dialog box.
Enter - Runs the "Replace all" operation, no need to click Find Next and then Replace All.
Esc - Finds and deletes the "markerhere" placeholder text, leaving the user at the originally active segment, and closes the Find and Replace dialog box.
#IfWinActive ahk_exe SDLTradosStudio.exe$^h:: Send ^c Sleep 200 Send ^a{right} Sleep 200 Send {Space}markerhere Sleep 100 Send ^{PgUp} KeyWait, h send ^h Sleep 200 Send ^v Sleep 100 Send {tab}return
#IfWinActive, Find and Replace, &Find what:Enter::Controlclick, Find &Next, Find and ReplaceSleep 1000Controlclick, R&eplace All, Find and ReplaceReturn
Esc::WinActivate, Find and ReplaceSendinput {Space}markerhereSleep 200Sendinput {tab}Sleep 200Sendinput {delete}Sleep 200Controlclick, Find &Next, Find and ReplaceSleep 1000Controlclick, R&eplace All, Find and ReplaceSleep 500Controlclick, &Close, Find and ReplaceSleep 200Return#IfWinActive
Translate