Search & replace multiple words/terms in pre-translated segments?

I often find myself doing multiple search & replace of the same words again and again in pre-translated segments and I'm thinking there's got to be a way to automate that somewhow, perhaps using a script. Any ideas?

emoji
Parents Reply Children
  •  

    The only problem for me is that I can get it going up to the drop-down list with the Ctrl+Alt+H shortcut, but then nothing happens.

    ok - so I have a few questions:

    1. have you created your search and replace text files?
    2. have you created a settings file and put the paths to the search and replace text files in it?
    3. have you replaced the hardcoded path in the script with the path to your own settings file instead of mine?
    4. is the drop down populated?
    5. if it is populated and you select a file have you then closed the window as that's the trigger to progress the script?

    I also noted that it is quite sensitive to spaces in the paths, use of an ampersand in the paths.  I didn't spend any time attempting to handle that... rather I simplified the paths ;-)  Certainly the potential for a problem

    Paul Filkin | RWS

    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
  •  

    Also...

    Not sure how I could fix this.

    Use ChatGPT!

    Paul Filkin | RWS

    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. Yes to all. Actually, when I close the window (which I wasn't doing when I wrote my earlier comment), it does cycle through all the replacements, but nothing gets changed in the target column.

    emoji
  •  

    What are the paths to your files?

    Paul Filkin | RWS

    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
  • The script file, settings file and replacements file are all in C:\AHK scripts\

    emoji
  •  

    File names?

    Paul Filkin | RWS

    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
  • Dropdown_Search_Replace.ahk
    settings.txt
    CFM_replacements.txt

    emoji
  •  

    Also what version of Trados Studio and what operating system.

    Gives you some idea of just how much error handling the development team need to put into every single small thing they build!!  Also explains whey it always works on "my computer"!

    Paul Filkin | RWS

    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
  • Trados Studio 2022 SR1 - 17.1.6.16252
    Windows 11 Home 10.0.2261 Build 22621

    Can it have something to do with where my trados files are located? Again, I can see the S&R box cycling through all the replacements in my replacement file, but nothing gets changed in the target column. Looks like we're very close, but...

    emoji
  •   

    I tried to replicate your setup as follows... all good:

    However...

    1. I don't have W11.  ChatGPT says this:
      "There aren't any inherent changes in Windows 11 that would directly impact the functionality of AutoHotkey scripts compared to Windows 10. However, there might be changes in user interface or system behaviors in Windows 11 that could affect the behavior of your script, especially if it relies on interacting with specific applications or parts of the Windows interface.  For instance, if an application's controls have changed (names, positions, etc.) in the new version of the OS, the script might fail to interact with them as expected. This might be relevant for your script, since it involves interacting with Trados Studio."

    2. I don't know what version of AHK you're running, I have 1.1.33.10.  You can use this single line script to get that:
      MsgBox % "AutoHotkey version: " . A_AhkVersion

    3. I don't know what your replacement file looks like... and empty rows, additional lines at the end or start?

    On point 1. I guess you could check the labelling I used for the search, replace and replace all button using AHK's Window Spy?  I used these:

    Edit2
    Edit1
    WindowsForms10.BUTTON.app.0.ea119_r8_ad19

    In that order.  I can't think why these would change, but probably worth checking.

    Paul Filkin | RWS

    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