• 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: email@hidden
  • Date: Fri, 17 Apr 2009 08:17:02 -0700

 Hey Oakley, 

While I don't disagree that automatic code generation is problematic, I know that in appleScript we're often at the mercy of developers and sometimes it is required, but it should be avoided.

That said, I also agree with Mark that we could be more helpful if we had more of the bigger picture of what you want to do.

If using record labels rather than variable names could work, try this.

HTH

ES

set animalRecords to {}

set animalList to {"Cat", "Dog", "", "Bird"}
set x to 0
repeat with thisCritter in animalList
set AppleScript's text item delimiters to {""}
if thisCritter as text is not "" then
set x to x + 1
set makeARecord to {"{rec", x, ": ", quote, thisCritter as text, quote, "}", return}
  set animalRecords to animalRecords & (run script makeARecord as text)
end if


end repeat

return animalRecords
--{rec1:"Cat", rec2:"Dog", rec3:"Bird"}

--Would Give   ListAnimals =  {"Cat","Dog","","Bird"}
--I want       ListAnimals =  {"Cat","Dog","Bird"}

 _______________________________________________
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

References: 
 >Re: Copy to list Question (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: Recycling Email Drafts in Mail
  • Next by Date: Re: Simply deleting a fil
  • Previous by thread: Re: Copy to list Question
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread