Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest way to populate a table from a list of lists



On 28-Sep-06, at 6:22 AM, T&B wrote:

Is there a faster way to populate a table from a list of lists?

It's really simple (as of Tiger). No need to mess with data sources if you just want to set the content of the table view directly. Just set the content of the table view to a list of lists, like this:



set myList to {{"line1item1", "line1item2"}, {"line2item1", "line2item2"}}
set content of table view 1 of scroll view 1 of window 1 to myList


The AppleScript Studio Terminology Reference section on table views discusses this, along with variations like this where you set data based on column names

set content of tableView to {{|name|:"John Smith", phone:"222-555-3456"}, {|name|:"Paul Jones", phone:"123-456-7890"}}


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Fastest way to populate a table from a list of lists (From: T&B <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.