MACSCRPT Archives

November 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Bill Steele <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 3 Nov 2008 13:16:44 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
>I know that I should already know this, but it's been a 
>while....I've slept since last attempting this years ago....
>
>How does one insert data into the middle of an existing list?
>
>For instance, I have a list of items, including lists. I want to 
>insert an item into a new second position in the original list.
>
>Here's the original list....
>
>Set myList to {itemA, {itemM, x}, {itemP, y}}
>
>I have a new itemZ that I want to put in as the second item of 
>myList that displaces the current second and third items to be items 
>3 and 4 of myList, with itemZ as the new second item.
>
>The new list should look like....
>
>{itemA, itemZ, {itemM, x}, {itemP, y}}
>
>Is there a simple call to do this? Or do I need to set up a complex handler?

There are scripting additions that let you just insert an item in a 
list. Not sure which ones still work with OS X.


-- 

Bill Steele
[log in to unmask]

ATOM RSS1 RSS2