Is it possible to trigger Confirm segment programmatically?

Hello,

Is it possible to trigger the built-in Confirm functionality programmatically from a Trados Studio 2015 plugin so simulate the "Ctr + Enter" key combination on the active segment?

3 Replies Latest Replies: 4 Dec 2017 5:38 AM by Romulus Crisan
  • Changing the confirmation can be done using the Studio Integration API, more exactly taking advantage of the EditorController. This gives access to the opened documented within you can access the active segment which exposes the confirmation level property. 

    Also I recommend browsing the code of the segment status switcher plugin here as it's implementing this.

  • In reply to Romulus Crisan:

    Thank you for your response. This is a useful example but I need to achieve the exactly same functionality that called by "Crt + Enter". Unfortunately, it seems that by changing the confirmation level programmatically, the studio doesn’t run the verifiers and I don’t exactly know what else happens when the user confirms the segment manually.

    By the business requirements, I need to implement a 3rd party integration plugin where the other application can control the Trados Studio and operates same as when the user generates events. The other application needs to be the in the foreground and the Trados can be even minimized. I’ve tried sending keyboard events from code with SendMessage and PostMessage but it’s not working maybe I’m sending the keyboard evet to the wrong control.

    Currently there is only one working solution, which is to bring the Trados Studion to the foreground, fire keyboard event with SendKeys.SendWait and bring back the previous foreground window (the controller application).

    Can you please advise how can I achieve this without bringing the Trados into the foreground?
  • In reply to Romulus Crisan:

    Dear Romulus, unlike the confirmation with Ctrl+Enter, the segment status switcher plugin does not save the translation unit to the TM(s) specified in the Studio project settings. How would you achieve this programmatically?

Related