Who called?
Who called?
- Subject: Who called?
- From: Dave Saunders <email@hidden>
- Date: Tue, 16 Jan 2001 14:39:09 -0500
I'm writing a bunch of scripts that are used either from the OSA menu or
from OneClick. They are all structured like this:
try
blah...blah...blah
return "OK"
on error
return ErrorMsg
end try
This works well for OneClick because it means that my AppleScripts always
return a value for it to chew on, even when they pull unexpected errors.
But, if I run that same script from the OSA menu and an error occurs, the
return error message has nowhere to go.
So, what I want to do is:
try
blah...blah...blah
return "OK"
on error
if OneClick called me then
return ErrorMsg
else
display dialog ErrorMsg
end if
end try
I'm not being rigorous with my syntax here, but you get the idea. The
question is, how do I do the test (if it's easier to test for OSA, then I
can reverse the if...then...else)?
Dave