• 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: text vs string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text vs string


  • Subject: Re: text vs string
  • From: Michael Turner <email@hidden>
  • Date: Tue, 06 Feb 2001 11:16:03 -0500

Thanks Nigel, but,

My head hurts.
:-0

Ok, so there is a finer distinction.

-Michael

> From: Nigel Garvey <email@hidden>
> Subject: Re: text vs string
>
> Michael Turner wrote on Mon, 05 Feb 2001 14:05:20 -0500:
>
>> I have noticed several examples of scripts with the data type "text" where I
>> would naturally have used "string". What is the difference between these
>> data types? I suspect that some of my frustration with strings in
>> AppleScript comes from utilizing them when I should be using data type
>> "text"
>
> Just to qualify Jeff's and Pier's responses to this, if I may: the terms
> are synonymous *in respect of coercions performed by AppleScript*. I know
> of one OSAX command ('the clipboard') where 'as string' is a parameter of
> the command itself, not a coercion performed on the result. It returns
> unstyled text if the clipboard contains text or a number. If you use 'as
> text' instead, the result is an empty list. (The 'path to' command, on
> the other hand, works equally well with either 'as string' or 'as text'
> as its parameter.)
>
> The 'text' class in a range (as opposed to a coercion) seems to be
> synonymous with the plural expression 'strings'.
>
> text 1 thru 8 of "Now here's a funny thing."
> --> "Now here"
>
> strings 1 thru 8 of "Now here's a funny thing."
> --> "Now here"
>
> text 1 thru 3 of {"Now", "here's", "a", "funny", "thing."}
> --> {"Now", "here's", "a"}
>
> strings 1 thru 3 of {"Now", "here's", "a", "funny", "thing."}
> --> {"Now", "here's", "a"}
>
> NG


References: 
 >Re: text vs string (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: text vs string
  • Next by Date: History of Scripting Terms (was Re: Attachability)
  • Previous by thread: Re: text vs string
  • Next by thread: Re: Re: text vs string
  • Index(es):
    • Date
    • Thread