How to execute a function against Segment Pairs from the selected file(s) from the Files view?

Here is the use case:

  • On the Files View
  • The user will select one or more files
  • When the user activates my plugin
  • Then the plugin will lock all of the segments in the selected files (but this could be any generic operation to the segments)

Here is what I have learned so far:

  • It appears the only way you can interact with one or more ISegmentPair objects is by interacting with a Document object.
  • One way of interacting with the Document object is through the EditorController.ActiveDocument property and other functions that refer to the Document while you are in the Editor view.
    • However, this breaks my use case because I don't want to have to be on the Editor view.
  • The other way I saw to get a document was the EditorController.Open() function which does return a Document object.  
    • At first glance, this seemed like this may have been what I was looking for; however, calling this function seems to do more than just open a file and return a document object.  It actually creates a single file project which you can see in the projects view after it has been called.  And again, this actually takes the user to the Editor view, which is not the desired behavior.

Is anyone aware of any way of interacting with Segment Pairs in a Document without actually having to be on the Editor View through the SDK?

Parents Reply Children