• 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: Copy to List Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Copy to List Question
      • From: Skeeve <email@hidden>
  • Prev by Date: Re: Copy to list Question
  • Next by Date: (no subject)
  • Previous by thread: Re: Copy to list Question
  • Next by thread: Re: Copy to List Question
  • Index(es):
    • Date
    • Thread