Some basic scripting questions
- I'm having a go at making the LaTeX mode more useful, largely through adding some
scripts. For those who might be interested, I'm chronicling my progress on my blog at
<http://appliedabstraction.blogspot.com/>. I've run into several questions about the
scripting model, and hope that someone can clarify things for me. I'll start with just a few
First, the SubEthaEdit scripting dictionary is such that windows can contain documents and
documents can contain windows. So, what is the right way to refer to the active tab in the
front window? Is 'tell front document of application "SubEthaEdit"' the right thing to do?
Should it be 'tell document of front window of application "SubEthaEdit"'? Both work, so is
there a reason to prefer one over the other, apart from the greater clarity of the former?
Second, is there any reason to check for an open document in a mode-dependent script?
As far as I can tell, the only way that such a script gets activated is when an appropriate
document is open. This implies that there will never be an error from referring to a non-
existent document in a modal script. Have I missed anything?
Third, how does collaborative editing interact with the idea of the selection? I don't really
use the collaborative features myself, but I tried some basic tests to get a feel for what's
needed. It appears that you only get access to your own selection, and not your
collaborators. For scripting, that would be just fine, since I could ignore the collaborative
part and not stumble into any difficulties. Should I expect any troubles from scripting
SubEthaEdit as if it were a "normal" non-collaborative editor?
These questions seem to me to be relevant to most of the scripts I have in mind. For
example, I present a script at <http://appliedabstraction.blogspot.com/2007/07/
seeing-latex-2-opening-pdf-in-viewer.html> where all three points came up
in the just six lines that related to SubEthaEdit.
I look forward to your comments.