Picking data from a record
Picking data from a record
- Subject: Picking data from a record
- From: John Fountain <email@hidden>
- Date: Fri, 24 Sep 2004 09:46:08 -0400
Hello List-
Below is a sample script to illustrate a problem I am having.
set testRecord to {H:"Height", W:"Width"}
set sampleData1 to {1, "H", 2}
set testThis to item 2 of sampleData1
set finalResult to (item testThis) in testRecord
I have a list of items. I want to pick one of the items from the list and if that item's contents corresponds to the name of one of the variables in a record I want a variable to be set with the contents of that variable in the record. Does that make sense? I can't seem to work around the error I get because the variable testThis is actually a string. I have tried to make it an item and so forth but I have run out of ideas.
My description probably isn't so great but hopefully the sample above will illustrate what I am trying to do. If the example makes sense then maybe someone can suggest a better way to accomplish the same thing without a giant, nested clump of if-then-else statements.
Thanks, All!
-john
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden