re: Copy to List Question
re: Copy to List Question
- Subject: re: Copy to List Question
- From: Oakley Masten <email@hidden>
- Date: Wed, 15 Apr 2009 07:50:15 -0700 (PDT)
Good Morning All
As usually you have enlightened me and I appreciate it.
The question was regarding trying to get a group of variables into a list using a repeat command.
It appears to not be "do-able".
I could not do it so was asking if anyone else could.
It is for a FaceSpan project I am working on to learn how to store variables and retrieve them later.
The obvious answer is of course:
set ListAnimals to {"Cat","Dog","Horse","Bird"}
and work with that. [Now, why would I want to do that if it can be done dynamically you ask? or at least I
did.]
I want them individually and as a list BUT only a list containing NO blanks.
I would have filtered out the blank ones in the repeat cycle.
So - is there anyway to coerce a sting into a variable [ like I was trying and failing to do ] ?
Can this be done?
It says Var is not defined.
How do I fix this?
set Var1 to "Cat"
set Var2 to "Dog"
set Var3 to "Horse"
set Var4 to "Bird"
set ListAnimals to {}
repeat with x from 1 to 4
copy (Var & x) to ListAnimals
end repeat
ListAnimals
Again, Thanks to all who have participated
Oakley
_______________________________________________
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