Re: booleans...
Re: booleans...
- Subject: Re: booleans...
- From: Stan Cleveland <email@hidden>
- Date: Mon, 19 Mar 2018 21:36:09 -0700
On Mar 19, 2018, at 09:29 PM, Jean-Christophe
> <email@hidden <mailto:email@hidden>>
> wrote:
>
> Obviously this:
>
> on myBoolean(myExpression)
> try
> myExpression
> return true as boolean
> on error
> return false as boolean
> end try
> end myBoolean
>
> doesn't work, since the error is caught before sending myExpression to
> myBoolean and I still end up with an error instead of FALSE...
But this does work:
on myBoolean(myExpression)
try
myExpression
set succeeded to true
on error
set succeeded to false
end try
return succeeded
end myBoolean
Stan C.
_______________________________________________
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