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