On 31 Mar 2017, at 2:06 pm, Christopher Stone <email@hidden> wrote:
I'm not sure about AppleScriptObjC.
No. You can make what's called an index set easily:
set theIndexSet to current application's NSIndexSet's indexSetWithIndexesInRange:{1, 1000}
But there's no built-in way to convert that to an array, and hence coerce to an AS list. You can do it with BridgePlus, although that's just getting more long-winded, and slower for lists less than tens of thousands of items long:
use AppleScript version "2.4" -- Yosemite (10.10) or later use framework "Foundation" use theLib : script "BridgePlus" version "1.3.2" use scripting additions
load framework set theIndexSet to current application's NSIndexSet's indexSetWithIndexesInRange:{1, 1000} set theList to (current application's SMSForder's arrayWithIndexSet:theIndexSet) as list
You could also do this, I suppose, although it probably no quicker:
use AppleScript version "2.4" -- Yosemite (10.10) or later use framework "Foundation" use theLib : script "BridgePlus" version "1.3.2" use scripting additions
load framework set theList to ((current application's SMSForder's arrayWithPattern:"%@" startNumber:1 endNumber:1000 minDigits:0)'s valueForKey:"integerValue") as list
OTOH, there are some (probably rare) cases where you can use an index set directly, and that might be faster (or not).
|