Re: Copy to list Question
Re: Copy to list Question
- Subject: Re: Copy to list Question
- From: Paul Scott <email@hidden>
- Date: Tue, 14 Apr 2009 18:36:45 -0700
I assume that the exercise was to try to coerce a string into a variable name. This is typically done to create and access arrays in some scripting languages that don't directly support them. To my knowledge, AppleScript doesn't allow such coercions, but then again it has lists. The correct way would be to start with a list in the first place, which obviates the need to coerce text into a variable name:
set myList to {"Cat", "Dog", "Horse", "Bird"}
then you could access individual items for copying to another list with something like you presented:
set ListAnimals to {} repeat with x from 1 to count of myList copy item x of myList to end of ListAnimals end repeat ListAnimals
Although, if you intended to copy all items you'd just use:
set ListAnimals to myList
Or, if all you wanted was the list:
myList
Paul |
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden