Need help with a script to confirm segments in TWS XLIFF Editor

Dear translating programmers,
Could you please help me make a script that presses Alt+[Numpad_Subtract] and then presses Enter when a pop-up window appears.
Using another script from Nora Diaz, I made a script that automatically confirms segments in TWS XLIFF Editor by pressing Alt+[Numpad_Subtract]. (Background: I translated an xlz file in SDL Trados Studio 2021 and need to re-confirm all segments in TWS XLIFF Editor.)
Here is the script (a first half):
--------------------
#IfWinActive ahk_exe xliffeditor.exe
!NumpadSub::
InputBox,Var,Confirm segments automatically, How many times do you want to run the sequence?
loop, % Var
{
Send !{NumpadSub}
Sleep 1000
}
#IfWinActive
return
--------------------
Now I need a second part of this script that presses Enter. When the said pop-up window appears, 'Yes' is already selected by default. Since I verify my translation in Studio with F8, I have read all the messages and don't need further control. Therefore, all I need is just pressing Enter (or clicking Yes) for every instance. I want it to be pressed automatically without my control so that I could just run the sequence and go to have a cup of tea. Any clue?Screenshot of Trados Studio XLIFF Editor with a pop-up window titled 'Problems found' indicating an error 'Space AFTER placeholder DIFFER in translation Tag: bpt; id: 6'. The 'Yes' button is highlighted with a red arrow and text overlay instructing to 'Press Enter when this window pops up.'



Generated Image Alt-Text
[edited by: Trados AI at 4:25 AM (GMT 0) on 5 Mar 2024]
emoji
Parents
  • Though there is a way to program such a script, TWS Xliff Editor offers this very feature right in the Batch operations... Just go to Translation Workspace menu > Batch Operations > Add to TM tab, addyour file(s), select the TM and languages, and press Add to TM... Done!

  • Hi Daniel,
    Thank you for your input. I didn't know I could do that. I will definitely use this option next time. However, this resolves only the first part of my task: add translations to TM. But then I need those translations from TM inserted in my target files. I cannot use files directly from Studio because Studio (and any other CAT tool other than TWS XLIFF Editor) changes the original file structure somehow. That is why I have to click Alt+NumpadSub through all the segments. As far as I understand, I could use Auto Translate (a synonym of Pre-Translate in TWS XLIFF Editor) for that, but I am not sure if it inserts all segments without skipping anything. In Studio, when you pretranslate a file, even 100% matches may turn 99% and be skipped (for formatting reasons for example or somehow else) when I select 100% as a minimum match value. 
    Also, I want to understand how to handle such pop-up windows in general. Just in case I may need this for some other purposes. So, I find your tip very useful because it does resolve what I need to resolve. But I still appreciate some sort of script for such pop-up windows. Thanks again.

Reply
  • Hi Daniel,
    Thank you for your input. I didn't know I could do that. I will definitely use this option next time. However, this resolves only the first part of my task: add translations to TM. But then I need those translations from TM inserted in my target files. I cannot use files directly from Studio because Studio (and any other CAT tool other than TWS XLIFF Editor) changes the original file structure somehow. That is why I have to click Alt+NumpadSub through all the segments. As far as I understand, I could use Auto Translate (a synonym of Pre-Translate in TWS XLIFF Editor) for that, but I am not sure if it inserts all segments without skipping anything. In Studio, when you pretranslate a file, even 100% matches may turn 99% and be skipped (for formatting reasons for example or somehow else) when I select 100% as a minimum match value. 
    Also, I want to understand how to handle such pop-up windows in general. Just in case I may need this for some other purposes. So, I find your tip very useful because it does resolve what I need to resolve. But I still appreciate some sort of script for such pop-up windows. Thanks again.

Children