I have a table where I allow the user to select multiple rows. I’d like to build a list from the contents of a cell for each selected item. I thought this would work but it does not…
if (count of selected_items) ≥ 1 then
set theIndexList to contents of data cell "myCell" of every data row in selected_items of theDataSource
end if
instead I have to loop through each selected item…
if (count of selected_items) ≥ 1 then
repeat with theRow in selected_items
set theIndexList to theIndexList & "," & contents of data cell "myCell" of data row theRow of theDataSource
end repeat
end if
tell (table view "tv" of scroll view "sv" of window "main")
set allItems to (content of data cell "myCell" of data rows of it's data source)
set theIndexList to ( call method "objectsAtIndexes:" of allItems ¬
with parameter (call method "selectedRowIndexes" of it) )
end tell
if (length of theIndexList ≠0) then -- testing for an empty selection
-- ....
end if