Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Offset vs Range methods

Method

offsetOfLocation:inString:

Summary

Convert a Cocoa location or NSRange to an AppleScript index

Signature

+ (NSUInteger)offsetOfLocation:(NSNumber *)location inString:(NSString *)aString

Parameters

location = a location in an NSString

aString = a string

Result

An integer

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 offsetOfLocation:2 inString:aString

--> 3

set theResult to current application's SMSForder's offsetOfLocation:4 inString:aString

--> 4


Click here to open script in a script editor