Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Offset vs Range methods

Method

offsetsOfRange:inString:

Summary

Converts from a Cocoa range to AppleScript offsets

Signature

+ (NSArray *)offsetsOfRange:(NSRange)range inString:(NSString *)aString

Parameters

range =

aString = a string

Result

Returns a list of two values, being the first and last character offsets

Availability

Version 1.0.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set aString to "A 😀 string."

set theResult to current application's SMSForder's offsetsOfRange:{location:0, |length|:6} inString:aString

ASify from theResult

--> {1, 5}

theResult as list

--> {1, 5}


Click here to open script in a script editor