• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: booleans...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: booleans...


  • Subject: Re: booleans...
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Tue, 20 Mar 2018 13:40:16 +0900

> On Mar 20, 2018, at 13:31, Stan Cleveland <email@hidden> wrote:
>
>> Is there a trick to have an error be coerced into a FALSE boolean ?
>>
>> I don't mind using try/on error but code would be so much cleaner with any
>> expression result could be coerced into a boolean... Any idea ?
>
> Hi Jean-Christophe,
>
> How about something like this?
>
>       try
>               "foo" as integer
>               set succeeded to true
>       on error
>               set succeeded to false
>       end try
>
> Stan C.


That doesn't work for any value of foo.

In this particular case (but in others I had other expressions) I'm trying to
find whether a file exists or not by using the "alias" trick, and I'd like to
use an OR clause between files existence tests.

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


 _______________________________________________
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

References: 
 >booleans... (From: Jean-Christophe Helary <email@hidden>)
 >Re: booleans... (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: booleans...
  • Next by Date: Re: booleans...
  • Previous by thread: Re: booleans...
  • Next by thread: Re: booleans...
  • Index(es):
    • Date
    • Thread