• 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: Alexis Gottlieb <email@hidden>
  • Date: Wed, 15 Apr 2009 09:51:53 +0200

Hi,

You can handle dictionaries (ie, associative arrays whose keys are strings) by using the plist commands of the free scripting addition XMLLib.osax (from Satimage-software):

set p to PlistNew
PlistSet p key "var1" to "Cat"
PlistSet p key "var2" to "Dog"
PlistSet p key "var3" to "Horse"
PlistSet p key "var4" to "Bird"

set ListAnimals to {}
repeat with x from 1 to 4
	copy (PlistGet p key ("var" & x)) to end of ListAnimals
end repeat
ListAnimals

--or:
set ListAnimals to PlistGet p key (PlistGetKeys p)

PlistClose p--free memory: p is not valid any more


XMLLib.osax is available at: http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html

Best regards,
Alexis


Le 14 avr. 09 à 23:25, Oakley Masten a écrit :

Hi All

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

Thanks
Oakley

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden


_______________________________________________
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:
    • Selecting files of type zip
      • From: "Sutapalli Satyanarayana" <email@hidden>
References: 
 >Copy to list Question (From: Oakley Masten <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: Selecting files of type zip
  • Index(es):
    • Date
    • Thread