I'm trying to integrate TextWrangler (a smaller BBedit) more closely
with Stata and have written a couple of applescripts to pass a file or
a selection of commands to Stata. I invoke TextWrangler with the shell
command and it works when creating a new file, but it does not work
when invoking TextWrangler with out opening a new file. Specifically,
when I type:
.shell edit -c myfile.do
TextWrangler opens up with the new file "myfile.do", and I can use my
applescripts to send the file back to Stata. However, if I then type:
.shell edit -l
TextWrangler comes to the front and the Stata icon bounces in the dock
(which it doesn't do if creating a new file). The problem is that if I
try to send the file back to Stata, the TextWrangler menu becomes
grayed out and the commands do not execute until I manually switch to
Stata.
I believe the problem is independent of the applescripts because
Stata's behavior changes for the two different ways of invoking
TextWrangler.
I'm sorry if this explanation is a little confusing, but does anyone
have an idea why one way works and the other doesn't and a way around
this problem?