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?