• 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 14:02:29 +0900


> On Mar 20, 2018, at 13:54, Shane Stanley <email@hidden> wrote:
>
> On 20 Mar 2018, at 3:43 pm, Jean-Christophe Helary
> <email@hidden <mailto:email@hidden>>
> wrote:
>>
>> myBoolean(alias (((path to desktop) & "not.there") as text))
>>
>> just gives me an error.
>
> You're trying to pass a statement, and it has to be evaluated to be passed to
> the handler. The answer is to put the code in-line:

I understand that. What I want, as I wrote earlier, is a way to coerce any
statement to boolean values instead of having to  add try block everywhere.
Either a statement returns a value and it is true, or it returns an error (or
nil) and it is false. A la lisp. Is that possible?

> As an aside, your original code is calling "path to desktop", which returns
> an alias, concatenating it with some text, which returns a list of an alias
> plus text, and then coercing that list to text, joining the two resulting
> strings with whatever your text item delimiters are set to at the time. As
> well as being inefficient, the delimiters issue makes it potentially very
> fragile.

Thank you. I somehow knew I was putting the "as text" in the wrong place... :)


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

  • Follow-Ups:
    • Re: booleans...
      • From: Shane Stanley <email@hidden>
    • Re: booleans...
      • From: Stan Cleveland <email@hidden>
References: 
 >Re: booleans... (From: Stan Cleveland <email@hidden>)
 >Re: booleans... (From: Jean-Christophe Helary <email@hidden>)
 >Re: booleans... (From: Shane Stanley <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