Friday, December 15, 2017

#1 2010-03-12 12:16:27 pm

iBackup
Member
Registered: 2004-07-26
Posts: 47
Website

Select Row Method selectRow:byExtendingSelection:

Hi

I use the code

Applescript:

set selected row of table view "a" of scroll view "a" of window "b" to 2

and I get the following comment in the Log after compiling:
*** WARNING: Method selectRow:byExtendingSelection: in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.

I looked up many posts but didn't find any help. Apple propose to use the method (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;, see http://developer.apple.com/mac/library/ … Notes.html

But in Applescript I can't use select row index or anything similar. sad

Does anyone have the same issue?


Regards
Martin


Filed under: select row

Offline

 

#2 2010-03-12 01:34:54 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: Select Row Method selectRow:byExtendingSelection:

iBackup wrote:

But in Applescript I can't use select row index or anything similar. sad


the AppleScript equivalent of selectRowIndexes:byExtendingSelection: might be

Applescript:


set selected rows of table view "a" of scroll view "a" of window "b" to {2}


regards

Stefan

Offline

 

#3 2010-03-12 04:00:39 pm

iBackup
Member
Registered: 2004-07-26
Posts: 47
Website

Re: Select Row Method selectRow:byExtendingSelection:

Hi Stefan

I tried that, but no luck, same error message...


Regards
Martin

Offline

 

#4 2011-07-26 04:20:23 pm

iBackup
Member
Registered: 2004-07-26
Posts: 47
Website

Re: Select Row Method selectRow:byExtendingSelection:

Here's the solution:

Applescript:


set tIndexLocation to 1
set tIndexLength to 2
set myRange to {tIndexLocation, tIndexLength}
set myIndexSet to call method "indexSetWithIndexesInRange:" of class "NSIndexSet" with parameter myRange
               call method "selectRowIndexes:byExtendingSelection:" of (table view "profiles mainwindow" of scroll view "profiles mainwindow" of split view 1 of window "iBackup") with parameters {myIndexSet, false}

Works from 10.3.9 to newest versions smile

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)