Re: Copy to list Question
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