Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Substring range methods

Method

rangesOfCharactersOfString:

Summary

"character" means "composed character sequence", as in AppleScript

Signature

+ (NSArray *)rangesOfCharactersOfString:(NSString *)aString

Parameters

aString = a string

Result

An array of range values

Availability

Version 1.2.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 rangesOfCharactersOfString:aString

ASify from theResult

--> {{location:0, length:1}, {location:1, length:1}, {location:2, length:2}, {location:4, length:1}, {location:5, length:1}, {location:6, length:1}, {location:7, length:1}, {location:8, length:1}, {location:9, length:1}, {location:10, length:1}, {location:11, length:1}}

theResult as list

--> {{location:0, length:1}, {location:1, length:1}, {location:2, length:2}, {location:4, length:1}, {location:5, length:1}, {location:6, length:1}, {location:7, length:1}, {location:8, length:1}, {location:9, length:1}, {location:10, length:1}, {location:11, length:1}}


Click here to open script in a script editor