Re: Script Fails in Snow Leopard - Adobe Unit Types.osax
Re: Script Fails in Snow Leopard - Adobe Unit Types.osax
- Subject: Re: Script Fails in Snow Leopard - Adobe Unit Types.osax
- From: Paul Scott <email@hidden>
- Date: Tue, 1 Sep 2009 19:14:08 -0700
I can't use "2>&1" because that interferes with getting the window
count. However, I *can* redirect stderr to /dev/null, and while that
got rid of the error messages, I'm still getting the prompt.
Sometimes. I'll work on that as a separate issue, which I'll deal with
myself.
In any case, I still don't understand the original error message. Why
am I getting an error (warning) about something that I'm not even using?
Paul
On Sep 1, 2009, at 6:34 PM, Deivy Petrescu wrote:
On Sep 1, 2009, at 9:04 PM, Paul Scott wrote:
So, let me get this right. I'm getting a warning about a scripting
addition that I'm not using, that Applescript isn't using, that
nobody is using, that someday someone might be using? Who's bright
idea was that?
Keep in mind that the warning is causing my script to fail. The
script was written so that if no other Terminal windows are open,
then Terminal quits. Otherwise, it only closes the window it opened
and leaves Terminal active. It has always worked fine. However,
because of this warning I am now prompted incessantly by Terminal
to verify that I want to close the window. I do have prompting in
Terminal turned on with exceptions, but no exceptions that I could
devise prevents the prompting, and before Snow Leopard the existing
exceptions worked fine.
Paul
Paul,
In my previous message I stated precisely what was causing your
problem.
When you call osascript from Terminal running in 64-bit then it will
try to load the OSAxen available and it will be able to load only
the 64-bit ones.
It is providing you with a message to let you know that, so if
expected to have a result from a 32-bit OSAX you should sit down and
wait. Forever!
If you do not want to have the error messages trap them in Terminal
tell application "Terminal"
activate
set w to front window
if busy of w then
set w to do script ""
end if
set s to ""
set s to s & "/bin/sh -c '"
set s to s & "ssh -t haven pine;"
set s to s & "COUNT=$(osascript -e \"tell application \\\"Terminal\\
\" to get count of windows\ 2>&1 &");" --->note the 2>&1 &
set s to s & "if [ 0$COUNT -le 1 ] ; then "
set s to s & "osascript -e \"tell application \\\"Terminal\\\" to
quit saving no\" 2>&1 &;"
set s to s & "else "
set s to s & "osascript -e \"tell application \\\"Terminal\\\" to
do script \\\"exit\\\" in selected tab of front window\" 2>&1 &;"
set s to s & "fi"
set s to s & "'"
do script s in w
end tell
Deivy Petrescu
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:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden