Re: Record Access osax
Re: Record Access osax
- Subject: Re: Record Access osax
- From: Graff <email@hidden>
- Date: Mon, 10 May 2004 20:32:23 -0400
Hmm, that's a good idea. Build it up as a string and then treat the
string as a script. Works for me!
- Ken
On May 10, 2004, at 7:01 PM, Andrew Oliver wrote:
Oops, you're right, I missed the 'record' part.
How about:
set list1 to {"a", "b", "c"}
set list2 to {1, 2, 3}
set cmd to "{"
repeat with i from 1 to (count list1)
set cmd to cmd & item i of list1 & ":" & item i of list2
if i < (count list1) then set cmd to cmd & ", "
end repeat
set cmd to cmd & "}"
run script cmd
--> {a:1, b:2, c:3}
Additional error checking is probably needed for production purposes
to make
sure the number of items in each list matches, and potentially to deal
with
other object types (what if list1 contains an integer, or list2 is a
list of
lists?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.