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:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 4 Nov 2008 08:33:44 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
On Mon, Nov 3, 2008 at 1:17 PM, Mark J. Reed <[log in to unmask]> wrote:
> This should work as a generic insertion handler, although I haven't tested it:

Ah, you apparently can't mix keyword parameters with even one
non-keyword parameter.  Try this:

on insertion of anItem into aList at aPosition
    return (items 1 through (aPosition-1) of aList) & anItem & (items
aPosition through end of aList)
end insert

set myList to {itemA, {itemM, x}, {itemP, y}}
set myList to insertion of itemZ into myList at 2
myList
 -- {itemA, itemZ, {itemM, x}, {itemP, y}}

--
Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2