Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

List manipulation methods

Method

arrayWithPattern:startNumber:endNumber:minDigits:

Summary

Pattern should be a string where every instance of %@ will be replaced by a number. So a pattern of "label%@", a startNumber of 3, an endNumber of 1 and minDigits 3 will return {"label003", "label002", "label001"}

Signature

+ (NSArray *)arrayWithPattern:(NSString *)patternString startNumber:(NSNumber *)startNum endNumber:(NSNumber *)endNum minDigits:(NSNumber *)minDigits

Parameters

patternString = a string containing %@ as placeholder

startNum = starting integer

endNum = last integer

minDigits = the number is padded out to this many digits

Result

Array of strings

Availability

Version 1.0.0

Notes

 

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set patternString to "File number %@"

set theResult to current application's SMSForder's arrayWithPattern:patternString startNumber:10 endNumber:20 minDigits:4

ASify from theResult

--> {"File number 0010", "File number 0011", "File number 0012", "File number 0013", "File number 0014", "File number 0015", "File number 0016", "File number 0017", "File number 0018", "File number 0019", "File number 0020"}

theResult as list

--> {"File number 0010", "File number 0011", "File number 0012", "File number 0013", "File number 0014", "File number 0015", "File number 0016", "File number 0017", "File number 0018", "File number 0019", "File number 0020"}



Click here to open script in a script editor