I feel that AXSelectedRows has finally beaten me into submission :) After extensive research, I am stumped as to how to programmatically list the contents of AXSelectedRows; simply put, to get the selected rows of any given AXOutline.
It sounds trivial, but finding an answer has proven difficult - particularly due to the lack of online documentation (though I should probably buy a book!) Strangely, a lot of people just seem to want to programmatically select rows, instead of getting selected rows.
I am certainly close though. I have reached thus far:
set selectedRows to value of attribute "AXSelectedRows" of outline1
outline1 is set to an AXOutline. Next:
set selectedRow to item 1 of selectedRows
This is where it becomes a little murky (after already failing to set it to
row 1 instead of
item 1). I would expect
selectedRow to be of type
row), but instead Automator output displays:
application "System Events"
That is, the item appears to be an instance of 'application "System Events"' - which leads me to believe that I'm overlooking something important. Having said that, I feel that I've tried every combination of
row's - including some type-casting.
The frustrating part is that I can actually see the contents of AXSelectedRows in the Accessibility Inspector! And so I know that it exists. As a workaround, I am using:
set selectedRows to selected of rows of outline1
However, this is certainly not preferable as I still have to loop through the entire array in order to find the 'true' values, which could have performance issues for very large lists.
Any help would be hugely appreciated!