Re: robust handling of return values
Re: robust handling of return values
- Subject: Re: robust handling of return values
- From: patrick machielse <email@hidden>
- Date: Mon, 14 Nov 2005 13:48:01 +0100
Op 11-nov-2005, om 18:51 heeft has het volgende geschreven:
patrick machielse wrote:
I've noticed that some AppleScript commands don't return values of
1 predefined type, but can return an 'array' of different things.
[...]
Now on to my question: how do I robustly check the result value of
the 'add' command?
Awkwardly. Performing a coercion on the command's immediate result
seems to work (touch-wood):
tell application "iTunes" to set L to (add {}) as list
L --> {}
It looked like a winner, but it doesn't work. In script editor L is
displayed as {}, but in fact it seems to be { current application }
(which is how L is displayed in Automator...)
I never imagined you could coerce 'nothing' into list. That shouldn't
be what coercing is supposed to be. It feels like creating matter out
of nothing... Welcome to the AppleScript twilight zone!
patrick
_______________________________________________
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