I’m setting up a table view that will take as input a list of records of the format:
set nounRec to {recType:"noun", term:{"user", "users"}, related:{"atom"}, genus:"user"}
I’ve (tried) to set up a datasource for the table using this code:
set wordSource to make new data source at end of data sources with properties {name:"words"}
-- Create each of the data columns, including the sort information
-- for each column
make new data column at end of data columns of wordSource with properties {name:"recType", sort order:ascending, sort type:alphabetical, sort case sensitivity:case sensitive}
make new data column at end of data columns of wordSource with properties {name:"genus", sort order:ascending, sort type:alphabetical, sort case sensitivity:case sensitive}
make new data column at end of data columns of wordSource with properties {name:"terms", sort order:ascending, sort type:alphabetical, sort case sensitivity:case sensitive}
make new data column at end of data columns of wordSource with properties {name:"related", sort order:ascending, sort type:numerical, sort case sensitivity:case sensitive}
-- Make this a sorted data source
set sorted of wordSource to true
-- Set the "name" data column as the sort column
set sort column of wordSource to data column "recType" of wordSource
-- Set the data source of the table view to the new data source
set data source of theObject to wordSource
-- Add the table data (using the new "append" command)
append wordSource with wordList
By debuggin I’ve gotten as far as the “set data source” line when it kluges to a stop with a “NSCannotCreateScriptCommandError (10)” error.
The only thing I can think is that some of the record items are, themselves, lists and perhaps table view/datasource don’t know what to do with them?
Would that be the case? Or should I look elsewhere? I’m also wondering if an outline view would accept that sort of disparity between record items (some strings, some lists) without complaining?
Model: iMac DV+ (450mhz), 384mb, 40gb HD
AppleScript: 1.9.3
Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060214 Camino/1.0
Operating System: Mac OS X (10.3.9)