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
  • You said it... wherever it is. Where is it?

    emoji
  •  

    Where is it?

    I don’t know, really. Where you saved it…

    emoji
  • I think at this point I should restart from scratch because I am not finding it anymore...

    emoji
  •  

    I think at this point I should restart from scratch because I am not finding it anymore...

    If I recall we put that in your windows start up folder so it's always available.  It's probably accessible through your task bar as well.

    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
  • Following this:

    C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    I arrive at Programs and then there is no folder called Startup or Avvio... ???

    emoji
Reply Children
  • And if you mean that I should see the green H icon in the bottom of my screen, no - I can't.

    Also, since my antivirus said that the script contained a virus, I quarantined it, as required. So now I am totally lost :-(((

    emoji
  •  

    Following this:

    C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    I arrive at Programs and then there is no folder called Startup or Avvio... ???

    I guess it might be here:

    C:\Users\[USERNAME]\AppData\Roaming\Microsoft\Windows\Menu Avvio\Programmi\Esecuzione automatica

    But if you really cannot find this folder then try to use shell:startup which you do like this:

    • Press Win + R, type shell:startup, and press Enter.
    • This should open the correct Startup folder, regardless of language settings.
    Also, since my antivirus said that the script contained a virus, I quarantined it, as required.

    I can understand why you might do that, but it's highly unlikely that the AHK script you have contains a virus.  I reckon it's more a problem related to your Antivirus software getting a bit excited, and in this case it was probably best ignored!

    If you can't find the scrip then simply open your text editor, copy the script into it and save it as find_replace.ahk into your startup folder.  Double click it to get in running now and see if this solves your problem?  If you get an Antivirus warning then you know that this is probably a false positive.  You might be able to resolve that by white listing the script in your Antivirus software.

    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
  • Thank you for your clear instructions, Paul. However, I had reached the "Esecuzione automatica" folder, but it was empty.
    Now I recovered the script file from the antivirus, but I cannot put it back (as a .txt file) in that folder or in AutoHotkey either... I created the file anew with the script inside, but it cannbot be saved anywhere! When I try to save, the command is simply not executed. That is quite strange, isn't it? How can this be solved?

    emoji
  •  

    Try saving the file to your desktop first so you have the file... and save it with the .ahk extension, not as a .txt file.  Once you've done that try to simply copy the file into your startup location.  If you cannot do that then it could be due to at least these reasons:

    1. The Startup folder is a protected system directory, and writing to it might require admin privileges.  So make sure you are running with admin rights.
    2. Windows Ransomware Protection (under Windows Security) includes Controlled Folder Access, which may block unauthorised programs from making changes to system folders like Startup.  Check in Windows Security -> Virus & threat protection -> Ransomware protection if this feature is enabled.
    3. Some third-party antivirus programs block unauthorised modifications to startup folders to prevent malware persistence.  Your antivirus software may need to be configured to allow changes to the Startup folder.

    Based on what you've said so far my money would be on what seems rather aggressive Antivirus settings.

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

    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