• 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: red_menace <email@hidden>
  • Date: Tue, 14 Apr 2009 23:32:11 -0600

Although you can't describe variables in that way (script objects can't be used either, as previously posted),
you can dynamically build label names for record items:

-- set up record object
set MyRecord to {Var1:"Cat", Var2:"Dog", Var3:"Horse", Var4:"Bird"}

set ListAnimals to {}
repeat with x from 1 to 4
GetRecordValue for ("Var" & x) from MyRecord
set the end of ListAnimals to the result
end repeat
log ListAnimals

-- get a value for dynamic record label
to GetRecordValue for SomeLabel from SomeRecord
run script "on run {parameters}
return " & SomeLabel & " of parameters
" & "end run" with parameters {SomeRecord}
end GetRecordValue

I am guessing that this is just some experimentation, since it's kind of a round about way to get a list item.

 _______________________________________________
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

  • Prev by Date: Re: Copy to list Question
  • Next by Date: Re: Copy to list Question
  • Previous by thread: Re: Copy to list Question
  • Next by thread: re: Copy to List Question
  • Index(es):
    • Date
    • Thread