Re: Really dumb question . . .
Re: Really dumb question . . .
- Subject: Re: Really dumb question . . .
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 26 Jul 2005 10:12:08 -0400
On 7/26/05,
Christopher Nebel <
email@hidden> wrote:
[N]o, there's no built-in way.
I suspected that was the case. Thanks for the confirmation.
Realize that AppleScript grew up in a world where the idea of
"standard output" was meaningless.
Yup. I just thought that since osascript runs in a world where
there is always a "standard output", it might supply some means for AS
to get to it.
It's useful to have actual use cases instead of just "it seems like this would be handy."
This isn't a very general use case, I'm afraid. I'm adapting my
previous all-UNIX, all-X11 shell environment to work better in OS
X. In particular, I've noticed some issues with xterm under
Panther (segfaults on resize are the most annoying), so I've begun to
switch to iTerm. At least until I convince my boss to upgrade my
work machine to Tiger. :)
But I have a lot of little utility shell scripts that open up xterms
for me: "open a new window with an ssh connection to this host", "open
a new window with root privileges", even just "open a new window,
maintaining the current working directory and shell environment".
Of course, the heart of all of these scripts is the "xterm"
command, which launches a new window. There's no convenient
"iterm" command, so I created one - using osascript to run an
AppleScript that tells iTerm to open a new window.
But I ran into a problem. As a systems administrator, one thing I
often have to do is log into several similar hosts at once to perform
the same task on all of them. Sometimes I can automate this
completely with a shell loop, but other times I need interactive shell
windows on all the hosts. So I have a command that takes a list
of hosts and opens up a new window with an ssh connection to each
one.
But apparently the consecutive invocations of iterm were too
close together, and iTerm got confused and stopped responding. To
try and figure out what was going on, I tried inserting log()
statements so I could see how far along in the series of iTerm commands
each instance was getting when they hit the problem.
Any other suggestions? I mean, I forcibly serialize things
- unlike xterm, the iterm command exits before the new window is
closed, so I can just wait for it to return before starting a new one -
but I'd kinda like to see exactly where I'm hitting the conflict.
I could put the debug statements in dialog boxes, but that might get
confusing and change the timing. log() does work in the Script
Editor, but I'm not sure how I can do the
overlapping-runs-of-the-same-script thing there...
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden