Find&Replace window on top again

Hello, possibly to @PaulFilkin, who helped me on this issue a few months ago,
I'm in trouble again with the F&R window that remains stuck on top of any page in my PC. Could be after the last Trados update?

I tried to repeat the AutoHotkey actions that were recommended to me, but to no avail. In addition to that, my antivirus is telling me that the script has a virus.

Can someone help?

Thanks in advance

emoji
Parents
  •  

    I'm in trouble again with the F&R window that remains stuck on top of any page in my PC. Could be after the last Trados update?

    From my point of view, this is the desired behaviour…

    I’ve checked it works like that in the following versions:

    Trados Studio 2022 SR2, 17.2.11.19134
    Trados Studio 2024, 18.0.2.3255

    my antivirus is telling me that the script has a virus.

    If you downloaded AutoHotkey from the real AutoHotkey page, you can add AutoHotkey to the white list of your antivirus software.

    I don't know which AutoHotkey code you tried. I’ve tried mine, and it works, but yours may be different. Could you please ensure that script is running in your PC and if so, post it here?

    emoji
  • Hi Jesus, I doubt that having Trados' Find & Replace window on top of Google or any other program that is not Trados could be considered a "desired behavior" by any translator. What would the purpose be? If I want to exit the Trados view for any reason, I will not need to have the Trados F&R window as top view in the other pages (any Google tab, Word, Acrobat...), am I wrong?
    Anyway, I re-copied and re-pasted the last script Paul Filkin gave me months ago, which mostly (but not 100% of times) solved the problem, but the egocentric F&R window is always there!

    emoji
  •  
    Hi Paul, I am really sorry to bother you again, but I am just realizing that, while the F&R window does no longer stay on top when I exit Trados, it's having the other problem I had months ago, namely that the Ctrl+H control does not open the Replace window directly, but only the Find window first and then I have to click again on the Replace tab to get that other option.
    I am afraid that I copied an older version of the script, as I remember you gave me 2 or 3 options along our discussions months ago. 
    So my question is: do you happen to have the full version (that resolves both problems) at hand?
    The one I have entered now is below. Can you check if it's the correct one?

    ;------------------------------------------------------------------------------
    ; Ensure "Find and Replace" window is always on top when Trados Studio is active
    ; and not always on top when Trados Studio is not active
    ;------------------------------------------------------------------------------

    #Requires AutoHotkey v2.0

    #HotIf WinActive("ahk_exe SDLTradosStudio.exe")

    $^f:: triggerFindAndReplace()
    $^h:: triggerFindAndReplace()

    triggerFindAndReplace() {
        find := "Find and Replace" ; Window title of the Find and Replace window
        Send '^f'
        If WinWaitActive(find, "", 2) {
            WinSetAlwaysOnTop(1, find) ; Use 1 for On
    ;        SoundBeep(1500)
        }
    }

    ; Check the active window every 100 milliseconds
    SetTimer CheckActiveWindow, 100

    CheckActiveWindow() {
        find := "Find and Replace"
        activeWin := WinExist("A")

        if activeWin and WinActive("ahk_exe SDLTradosStudio.exe") {
            if WinExist(find) {
                WinSetAlwaysOnTop(1, find) ; Turn on always on top if Trados Studio is active
            }
        } else {
            if WinExist(find) {
                WinSetAlwaysOnTop(0, find) ; Turn off always on top if Trados Studio is not active
            }
        }
    }

    #HotIf

  •  

    To be honest I didn't keep track of this.  So here's the one I have running in my own AHK... perhaps this is what you need?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ;------------------------------------------------------------------------------
    ; Ensure "Find and Replace" window is always on top when Trados Studio is active
    ; and not always on top when Trados Studio is not active
    ;------------------------------------------------------------------------------
    #Requires AutoHotkey v2.0
    global isOnTop := false
    $^f:: triggerFindOrReplace("Find")
    $^h:: triggerFindOrReplace("Replace")
    triggerFindOrReplace(action) {
    global isOnTop
    findTitle := "Find and Replace"
    if (action = "Find") {
    Send '^f'
    } else if (action = "Replace") {
    Send '^h'
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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

    emoji
  • ahah , you are asking ME? I don't know what "I need" - I am not the technician! I will try it... the Find & Replace window occasionally still remains on top when I open pages outside Trados even with the last script... it's an endless story. I wonder why - I had never had this issue before, in decades of Trados use... :-(((

    emoji
  • I tried this one too, but the problems remain:
    1- When I press Ctrl+H, the window that opens up is the Find window, not the Replace one:

    Screenshot of a 'Find and Replace' dialog box with the 'Find' tab active, showing an input field for 'Find what:' with a blue selection but no visible text.

    2. If I click on the symbol on the right of the "Find what:" line to get previous insertions, the command does not work (it flips away without staying, thus preventing me to fix it or write in it)

    Screenshot of a 'Find and Replace' dialog box with the 'Replace' tab active, 'Find what:' field contains a blue selection, 'Replace with:' field contains the text 'di prima linea'.

    3. Strangely enough, the F&R window still remains on top of Google or Word NOW AND THEN. This is really weird, isn't it? If the script is activated upon starting the PC, why should this change during the same work session?

    I keep wondering what has gone wrong with the programming of version 2022/24, as I never had these problems with ALL the previous Trados versions, since the dongle times! Can some programmer resolve this once and for all, with a patch maybe?

    And, for the moment, can you create another script that solves all these problems?

    Thank you in advance!

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 11:24 AM (GMT 0) on 22 Mar 2025]
  •   Hi Paul, did you have a chance to see my message?

    emoji
  •  

    Yes... I have seen your message.  I just tested on my own machine and this same script is still working as well as it can.  So, I had a play using a new AI tool I'm finding to be pretty good at AHK scripting and this one also works for me, but perhaps will be better in your circumstances:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ;------------------------------------------------------------------------------
    ; Ensure "Find and Replace" window is always on top when Trados Studio is active
    ; and not always on top when Trados Studio is not active. New Version 2.0
    ;------------------------------------------------------------------------------
    #Requires AutoHotkey v2.0
    ; Global variable to track the "Always on Top" state
    global isOnTop := false
    global findTitle := "Find and Replace"
    ; Hotkeys for triggering Find or Replace
    $^f:: TriggerFindOrReplace("Find")
    $^h:: TriggerFindOrReplace("Replace")
    TriggerFindOrReplace(action) {
    global isOnTop, findTitle
    static studioExe := "ahk_exe SDLTradosStudio.exe"
    ; Send the appropriate hotkey
    Send (action = "Find") ? "^f" : "^h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Give that a try and see if it works better for you?

    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

    emoji
  • Hi Paul, I replaced the old script with this last one you sent me, but the problem is not solved. Not the "on top" issue - that one is ok -

    but the other issue: when I click Ctrl+H I should obtain the REPLACE window (not the Find, which is Ctrl+F) 

    AND
    in any of the two (Find or Replace) I cannot view the list of the previous entries by clicking with the mouse on the right end of the writing line.

    The line just flips away and the former entry does not stay, obliging me to retype them each time! 

    That is a great nuisance, because I use the Find and Replace functions a lot while working.

    And the thing that disturbs me most is that I had never had this problem before - before the 2022/24 version, I mean.

    Can this be resolved once and for all? It is important for me. Thank you.

    emoji
  •  
    And another strange thing that happens is that each time I start my PC, the script page is automatically opened in the Notepad with the booting process and I have to close it down each time. This also did not happen before... is there a possibility to exit from this tunnel?

    emoji
  •   

    It sounds to me as though you saved the file in your startup folder with a txt extension… something like that but not .ahk

    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

    emoji
  • I entered this file name:
    Paul Filkin script dated 6 March 25.ahk

    emoji
Reply Children