if name of theObject is "test" then
try
set tableView to table view "contacts" of scroll view "contacts" of window of theObject
set selectedDataRows to selected data rows of tableView
display dialog "haha"
if (count of selectedDataRows) > 0 then
tell window of theObject
display dialog "hih"
-- Remove the contact form the data source
delete (item 1 of selectedDataRows)
display dialog "hoho"
end tell
end if
end try
end if
Using this code I am able to delete the requested row, but I get an ugly Applescript error:
Can’t make item 1 of item 0 of {{“In”, “1”, “+4367682007038”, “TtttrfffffhhhiuuuuiiiiOK”}} into type string. (-1700)
The Error pops up before “hoho” - but the row will be deleted…
I even tried “delete (every item of selectedDataRows” but this ended up in opening the debugger…
if name of theObject is "Delete Row" then
set Selected_Row to selected data rows of table view "Your_Table_View" of scroll view "Your_Scroll_View" of window "main"
repeat with r_ow from 1 to length of Selected_Row
set delete_row to item r_ow of Selected_Row
delete delete_row
end repeat
end if