SetActiveSegmentPair does not jumps to the segment

Hi All,

I have a Trados Studio project from a client, which contains multiple files. The plugin fails to jumps to segments under specific conditions in this project, but that happens only for that project, so with other projects it is not reproducible. I have created a minimal Trados project (based on this problematical project) and a minimal Studio project, which I can share in private. 

The problem is that, if you select multiple files in the Trados Studio project, right click and open all of them for translation (in this case one document is opened, which contains all the segments from all the documents). Then if you try to programmatically jump to a segment (eg with ID "3"), then the SetActiveSegmentPair method returns false and does nothing . Check the code below (the code is for Trados Studio 2019/2021). In this example I use the last project file, however it does not work either of the project files. If I open one file at a time (so not multiple as one), then it works. As I mentioned it also works for other projects, if i open multiple file as one.

    var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    if (editorController.ActiveDocument == null) return;
    var paramFile = editorController.ActiveDocument.Files.LastOrDefault();
    // return false and nothing happens (with any file with any segment id)
    var ret = editorController.ActiveDocument.SetActiveSegmentPair(paramFile, "3", true);

Best regards,

Balazs

Parents Reply Children
No Data