It took me awhile to find out how to get the text content of selected rows in an AppleScript Studio table view. Thanks to another post I was able to get what I needed. Note that I use a ‘on selection changed’ handler. This lends itself well to selecting text and getting the result. So here’s the the essential lines you need:
on selection changed theObject
set mySelection to selected data rows of table view 1 of scroll view 1 of window 1
end selection changed
To extract the text from ‘mySlection’ you would use a ‘repeat with thisRow in theDataSource’ with ‘set thisContent to (the contents of data cell yourNumber of thisRow) as text’ chunk of code. For example to get the content of each 7th cell of each row do the following:
on selection changed theObject
set mySelection to selected data rows of table view 1 of scroll view 1 of window 1
repeat with thisRow in theDataSource
set thisContent to (the contents of data cell 7 of thisRow) as text
display dialog thisContent
end if
end repeat
end selection changed
Hope this saves someone some time. Now if I can just figure out how to hook up the copy and paste menu items so they work…