Yes, that's it. The singular "set selected data row ... to ..." is
expecting a reference to a data row that would look something like:
'data row id 18 of data source id 3 of application "xyz"'. So "set
selected data row ... to 0" won't work. But obviously in this instance
you can't pass it a reference to a data row because you want to select
nothing (you want to deselect)! However the plural "set selected data
rows ... to {}" works whether the table view is configured to allow
multiple row or only single row selections.
Philip
On 26 Apr 2005, at 17:37, Brad wrote:
Philip,
I do, indeed, work with data sources. I had tried "set the selected
data row ... to 0" as multiple rows can not be selected. I hadn't
thought to set it to an empty list. I will have to remember that.
Brad
-----
MERGER: when 1 + 1 = 1, with the remainder going on unemployment. --
The Cynic's Dictionary
On Apr 26, 2005, at 10:30 AM, Philip Buckley wrote:
Brad,
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
_______________________________________________
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