• 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: List Question: Can someone explain this to me?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: List Question: Can someone explain this to me?


  • Subject: RE: List Question: Can someone explain this to me?
  • From: "Steve Goodman" <email@hidden>
  • Date: Thu, 13 Jun 2002 10:36:20 -0500
  • Thread-topic: List Question: Can someone explain this to me?

I think what your looking for is:

copy m to n

Steve

> ----------
> From: email@hidden
> Sent: Thursday, June 13, 2002 10:22 AM
> To: email@hidden
> Subject: List Question: Can someone explain this to me?
>
> I have a script which creates two lists from one piece of data. The lists
> are called Artwork and ProductCode
>
> The script then goes through each item in Artwork and precedes it with
> "Studio:Artwork:Lineart:"
>
> For some reason that has been driving me mad all day, this change is also
> reflected in the ProductCode list.
>
> Because of this, I wrote a little experiment. It does the same thing
>
> set m to {1,2,3,4,5}
> set n to m
>
> set item 1 of m to 7
>
> item 1 of n
> --> 7
>
> Setting n to m sets n as a reference to m. But I want n to be a copy of m
> that doesn't change when I change m. Obviously,
>
> set m to 5
> set n to m
> set m to n+2
> n
> --> 5
> m
> --> 7
>
> works. But lists aren't maths...
>
> The workaround that I've used is to duplicate the code that creates the
> Artwork list replacing the word "Artwork" with "ProductCode". That doesn't
> seem to me the "correct" way to do it though - even though it works.
>
> What magical class or coerce command am I missing? I tried 'as list'
>
> Thanks in advance,
>
>
> Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: can I do this better?
  • Next by Date: Re: List Question: Can someone explain this to me?
  • Previous by thread: List Question: Can someone explain this to me?
  • Next by thread: Re: List Question: Can someone explain this to me?
  • Index(es):
    • Date
    • Thread