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

    ;------------------------------------------------------------------------------
    ; 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'
        }
    
        If WinWaitActive(findTitle " ahk_exe SDLTradosStudio.exe", "", 2) {
            ; Ensure Always on Top when the window is active in Studio
            if !isOnTop {
                WinSetAlwaysOnTop(1, findTitle " ahk_exe SDLTradosStudio.exe")
                isOnTop := true
            }
        }
    }
    
    ; Check the active window every 100 milliseconds
    SetTimer(CheckActiveWindow, 100)
    
    CheckActiveWindow() {
        global isOnTop
        findTitle := "Find and Replace"
    
        if WinActive("ahk_exe SDLTradosStudio.exe") {
            if WinExist(findTitle " ahk_exe SDLTradosStudio.exe") {
                if !isOnTop {
                    WinSetAlwaysOnTop(1, findTitle " ahk_exe SDLTradosStudio.exe")
                    isOnTop := true
                }
            }
        } else {
            ; If Trados Studio is not active, remove the Always on Top status
            if isOnTop and WinExist(findTitle " ahk_exe SDLTradosStudio.exe") {
                WinSetAlwaysOnTop(0, findTitle " ahk_exe SDLTradosStudio.exe")
                isOnTop := false
            }
        }
    }

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

    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?

    ;------------------------------------------------------------------------------
    ; 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'
        }
    
        If WinWaitActive(findTitle " ahk_exe SDLTradosStudio.exe", "", 2) {
            ; Ensure Always on Top when the window is active in Studio
            if !isOnTop {
                WinSetAlwaysOnTop(1, findTitle " ahk_exe SDLTradosStudio.exe")
                isOnTop := true
            }
        }
    }
    
    ; Check the active window every 100 milliseconds
    SetTimer(CheckActiveWindow, 100)
    
    CheckActiveWindow() {
        global isOnTop
        findTitle := "Find and Replace"
    
        if WinActive("ahk_exe SDLTradosStudio.exe") {
            if WinExist(findTitle " ahk_exe SDLTradosStudio.exe") {
                if !isOnTop {
                    WinSetAlwaysOnTop(1, findTitle " ahk_exe SDLTradosStudio.exe")
                    isOnTop := true
                }
            }
        } else {
            ; If Trados Studio is not active, remove the Always on Top status
            if isOnTop and WinExist(findTitle " ahk_exe SDLTradosStudio.exe") {
                WinSetAlwaysOnTop(0, findTitle " ahk_exe SDLTradosStudio.exe")
                isOnTop := false
            }
        }
    }

    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
Children
No Data