• 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: Record Access osax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Record Access osax
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Record Access osax (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Easy way to get a app version number?
  • Next by Date: Quark 6, 10.3.3 Every character whose character is "$"
  • Previous by thread: Re: Record Access osax
  • Next by thread: Re: Record Access osax
  • Index(es):
    • Date
    • Thread