doubleclicking data item in table view

I’m writing a applescript application that uses a tableview to list files and some of their characteristics. I’d like to have the user doubleclick on an item in the view and have that file opened.

There are really two problems with this:

  1. I think that the on “double clicked” handler, in conjunction with the “clicked row of table view …” property shoudl work (although I haven’t coerced it into working yet). If anyone can offer any advice or code here, it’d be much appreciated.

  2. The main problem is that, upon a double-click, the data item becomes editable. Does anyone know of a way to change this default behavior?

Thanks,

Isaac Vetter

Hi Isaac,

‘editable’ can be set in interface builder - you might haven’t found it since you have to set this for NSTableColumn, not for the NSTableView - just click on the top of the column you want to be non editable …

D.

Dominik,

You rule.

Thanks alot.

Isaac

For the sake of completeness, I’m posting the answer to the above question that I asked yesterday. If you’re using a data source tied to a table view, the applescript documentation for the table view has this example for doubleclicking:

[i]
To get information from a named data cell in a data row of a table view with a data source, you can use statements like those in the following clicked handler, connected to the table view.

on clicked theObject
set rowIndex to clicked row of theObject
if rowIndex is greater than 0 then
set dataSource to data source of theObject
set theRow to data row rowIndex of dataSource
set theName to contents of data cell “name” of theRow
end if
end clicked
[/i]

Isaac Vetter