• 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: Arrays in AppleScript ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arrays in AppleScript ?


  • Subject: Re: Arrays in AppleScript ?
  • From: Mark Lively <email@hidden>
  • Date: Wed, 28 Dec 2005 14:01:43 -0500

On 12/28/05, Eric Morand <email@hidden> wrote:
> Hi List !
>
> This will probbably seems completely stupid to most of you
> but...where are the arrays in AppleScript ?
>
> I'm pretty sure lists are what I'm looking for but I just can't find
> how to create one.
>
> I suppose "set myArray to make new list" should work...but it
> doesn't. Worse, I don't even a have clue on how to add an entry to my
> array !
>
>
> If someone can help, that would be great because even with Google, I
> couldn't find the answer (I suppose this is so obvious to everyone
> but me that it isn't documented).
>
>
>
> Thanks,
>
>
> Eric.
>
>

Concisely AppleScript doesn't have Arrays per se.  It has lists which
are implemented as linked lists.  It is possible to force them to be
stored as arrays(or it used to be) but there isn't much practical
purpose to it.

set foo to {} --makes an empty list
set bar to every word of "This is a test"
set baz to {} & "This" &"is"&"a"&"test" --yields the same as the above.

--to add to foo
set foo to foo & 1
--{1}
set bar to 1&bar
--{1, "This" ,"is","a","test" }
item 3 of bar
-- "is"

-Mark
Array is like a shark except squished all flat.
 _______________________________________________
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

  • Follow-Ups:
    • Re: Arrays in AppleScript ? [Solved]
      • From: Eric Morand <email@hidden>
References: 
 >Arrays in AppleScript ? (From: Eric Morand <email@hidden>)

  • Prev by Date: Re: Arrays in AppleScript ?
  • Next by Date: Re: Arrays in AppleScript ? [Solved]
  • Previous by thread: Re: Arrays in AppleScript ?
  • Next by thread: Re: Arrays in AppleScript ? [Solved]
  • Index(es):
    • Date
    • Thread