Previous | Index | Next |
List manipulation methods
arrayWithPattern:startNumber:endNumber:minDigits:
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"}
+ (NSArray *)arrayWithPattern:(NSString *)patternString startNumber:(NSNumber *)startNum endNumber:(NSNumber *)endNum minDigits:(NSNumber *)minDigits
patternString = a string containing %@ as placeholder
startNum = starting integer
endNum = last integer
minDigits = the number is padded out to this many digits
Array of strings
Version 1.0.0
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"}