inconsistencies in getting a non-existent object
inconsistencies in getting a non-existent object
- Subject: inconsistencies in getting a non-existent object
- From: has <email@hidden>
- Date: Sun, 26 May 2002 21:43:42 +0100
Hi,
[Thanks go to Anthony Adachi for drawing my attention to the following
problem.]
Below is a test script. I would expect the 'get test2 of foo' line to
generate a "Can't get test2 of foo" error -1728.In practice, life does not
appear quite so simple...
THE SCRIPT:
script foo
script test1
end script
end script
on run
try
get test2 of foo
--get result
on error e number n
display dialog e & n
end try
end run
[Note: for clarity, I'm trapping the error and displaying the message in a
dialog.]
--
THE RESULTS:
- In Script Editor it displays a dialog "Can't make some data into the
expected type.-1700"
- In Smile it gives the dialog "Can't get test2.-1728"
- When running as an applet, I get the same error as SE.
- Script Debugger 3.0.3, however, swans right through the script, no dialog
appearing at all. The following appears in its Apple Event log:
---------------------
Script "untitled 4" started
tell current application
get test2
end tell
Script "untitled 4" finished
---------------------
Note: if you uncomment the 'get result' line, SD will now give the dialog
"The variable result is not defined.-2753". (Well, at least it notices
*something* I can trap...<sigh>)
--
THE QUESTION:
What the #@$*!! is the reason for such horribly inconsistent behaviour
between these different environments? The SE/applet/Smile disagreement on
what error to throw seems downright bizarre, while SD has me at a _total_
loss.
HELP!!!
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.