If you have a table view with a data source, the second of Matthew's
lines, "set selected row ... to 0", indeed does not work (it only works
for a table view without a data source).
With a data source you want to say "data rows" or "data row" not "rows"
or "row", so the line would be:
set selected data rows of table view "myTable" of scroll view
"myTable" of window "myWindow" to {}
Slightly curiously Matthew's first line, "set selected rows ... to {}",
does work for a table view with a data source as well as for a table
view without a data source. Nevertheless I use "data rows" if with a
data source - just so I don't confuse myself!
That said, I personally haven't had any problems using the call method
line either, although if I use it I use a slightly different syntax:
call method "deselectAll:" of object (table view "myTable" of scroll
view "myTable" of window "myWindow")
I am not qualified to say whether the pure applescript line is
preferable to the call method line or vice versa.
Philip
On 26 Apr 2005, at 16:23, Brad wrote:
Matthew,
I've tried using the code you have suggested below but to no avail. I
ended up using the "deselectAll:" method. The code you suggest SHOULD
work. I'm not sure why I haven't been able to make it work for me. No
errors generated, no results either (i.e.: the selection remains).
set selected rows of table view "myTable" of scroll view "myTable" of
window "myWindow" to {}
orĀ
set selected row of table view "myTable" of scroll view "myTable" of
window "myWindow" to 0