AppleScript how to get the document in the asistent editor

How do I know if the asistent editor is open? How to tell if focus is in the editor or assistent editor? I need to copy text from the editor that has the focus.

Which version Xcode?

AppleScript how to get the document in the asistent editor
 
 
Q