Selected data row

Hi there!

I’ve got a table and using the following code to retrieve a piece of info from the data source:

set TheContent to contents of data cell 2 of selected data row of table view "Test" of scroll view "Test" of tab view item "TabViewItem" of tab view "Main" of window "TheApp"

The problem is that it doesn’t spit all the items that I’ve selected, plural of “row” triggers an error.

Any help appreciated.

Hi,

You can’t do that because ‘selected data rows’ is a list and not multi threaded. Something like this works:

set sel_data_rows to selected data rows of table view "table" of scroll view "scroll" of window "main"
set target_data to {}
repeat with this_data_row in sel_data_rows
	set d to contents of data cell 2 of this_data_row
	set end of target_data to d
end repeat

I think there might be a way to do it with a filter though.

Edited: I give up on finding a filter reference form.

gl,

Kel, many thanks, I learned something here.

Micha