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
  • Now the problem also is that I removed the old scripts in the attempt at enabling the new one and now I've lost everything. 

    Consider that I do not understand anything of these things and that handling AutoHotkey for me is like trying to understand a text written in Arabic or Russian... Is there any difference between AutoHotkey and AutoHotkey Dash? Because I do not see the H icon in the right side

    Anyway, one script was this:

    ;------------------------------------------------------------------------------
    ; 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

    ; Initialize the global variable
    global isOnTop := false

    #HotIf WinActive("ahk_exe SDLTradosStudio.exe")

    $^f:: triggerFindOrReplace("Find")
    $^h:: triggerFindOrReplace("Replace")

    triggerFindOrReplace(action) {
        global isOnTop
        find := "Find and Replace" ; Window title of the Find and Replace window

        if (action = "Find") {
            Send '^f'
        } else if (action = "Replace") {
            Send '^h'
        }

        If WinWaitActive(find, "", 2) {
            if !isOnTop {
                WinSetAlwaysOnTop(1, find) ; Set Always-on-Top only once
                isOnTop := true
            }
        }
    }

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

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

        ; Add a small delay to ensure the active window is fully registered
        Sleep(100)
        if WinActive("A") != activeWin {
            return  ; The active window has changed, do nothing
        }

        if activeWin and WinActive("ahk_exe SDLTradosStudio.exe") {
            if WinExist(find) and !isOnTop {
                WinSetAlwaysOnTop(1, find)
                isOnTop := true
            }
        } else {
            if WinExist(find) and isOnTop {
                WinSetAlwaysOnTop(0, find)
                isOnTop := false
            }
        }
    }

    #HotIf

    emoji
  •  

    Is there any difference between AutoHotkey and AutoHotkey Dash?

    You don’t need AutoHotkey Dash. You just need to double click the AHK file with the script, wherever it is.

    Maybe you can verify your setup with these 2 posts?

     Set a window Always On Top 

     Studio 2022 Find/Replace dialog box is always displayed on top 

    emoji
Reply Children