"sorted data rows" of a data source __doesn't__ work every time

Hi *,
I’ve a hard :stuck_out_tongue: problem with property “sorted data rows” of my data source connected to a table view: it doesn’t work every time… :mad:

Here is my code:


    set theDataSource to data source table view "x" of scroll view "x" of window "main"
    set sortedDataRows to (sorted data rows of theDataSource) -- <-- this row doesn't every times
    set numSortedRows to (count of sortedDataRows)

P.S. Of course theDataSource’s “sorted” property is set to true and “sort column” set to one of his columns.

At run-time the error message of dialog box says: “AppleScript error: the variable sortedDataRows is not defined (-2753)” :frowning:
In “build and debug” mode with a breakpoint on the signed row of my code that code row doesnt’ work every time: in “locals” sometime I see the correct “sortedDataRows” list but most of times i see nothing like if the variable did not come set. :frowning:

Same problem with XCode 2.0 and 2.1

Please, help me
Thanks,
sixware.

Model: Mac-mini
AppleScript: 1.4
Browser: Firefox 1.0.4
Operating System: Mac OS X (10.4)

Hi, sixware,

I think you posted in the wrong section. Anyway, don’t you sort by columns. I don’t have the xcode version, but I don’t think there is a sorted data row property of a data source.

gl,

Kel,

Granted, this is in the wrong section, however, as of Xcode 2.0 (or 2.1, I’m not sure which) there is a “sorted data rows” property for data sources. The following is from the Applescript Studio Terminology Reference:

sorted data rows
Access: read only
Class: list
the data rows of the data source in its currently sorted order

Sixware,
I haven’t been able to get it to work either.

Brad Bumgarner, CTA