• 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: Mr Tea <email@hidden>
  • Date: Thu, 29 Dec 2005 18:07:21 +0000

This from has - dated 28/12/05 22.05:

>> What's a lot trickier in AppleScript than in some other languages is to
>> insert a new element somewhere in the middle.
>
> Not so much tricky as impossible


set mylist to {}
set int to 1
repeat 10 times
    set end of mylist to int
    set int to int + 1
end repeat

set listinsert to 7.5
set end of mylist to 0
set listcount to count mylist
repeat 3 times
    set item listcount of mylist to item (listcount - 1) of mylist
    set listcount to listcount - 1
end repeat
set item listcount of mylist to listinsert

mylist --> {1, 2, 3, 4, 5, 6, 7, 7.5, 8, 9, 10}


:-)



Nick
pp Mr Tea

--


 _______________________________________________
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 ?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Arrays in AppleScript ? (From: has <email@hidden>)

  • Prev by Date: Re: hdiutil burn
  • Next by Date: Removing a Keychain Item
  • Previous by thread: Re: Arrays in AppleScript ?
  • Next by thread: Re: Arrays in AppleScript ?
  • Index(es):
    • Date
    • Thread