Mailing Lists: Apple Mailing Lists

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

Fastest way to populate a table from a list of lists



Hi all,

What's the fastest way to populate a table with the contents of a list?

I have an AppleScript list in the form of:
{{"line1item1", "line1item2",...},{"line2item1", "line2item2"...},...}

that I want to put into a table. The table has a data source.

I've used this in an "on will open" handler, to populate the "myListSource" data source of a table:

repeat with rowN from 1 to length of myDataList
  set myDataRow to item rowN in myDataList
  tell myListSource
     set newDataRow to make new data row at end of data rows
     repeat with columnN from 1 to length of myDataRow
        set contents of data cell columnN in newDataRow to item columnN in myDataRow
     end repeat
  end tell
end repeat

But when I do this (section of code above) from a list of about 36 columns and 300 rows, it takes about 5 seconds (Intel Dual 1.8GHz), which is slower than I'd like.

I tried using "make new data row... with data" and a list of values for that row:

set newDataRow to make new data row at end of data rows with data myDataRow

But it gets a runtime error. Is it possible to use "make new data row... with data"?

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

Thanks,
Tom

_______________________________________________
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


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.