Scripting Additions Guide
Table Of Contents
CHAPTER 2
Scripting Addition Commands
40 Command Definitions
PARAMETERS
stringToFind
The string to find in stringToSearch.
Class: String
stringToSearch
A string containing stringToFind.
Class: String
RESULT
The result is an integer that indicates the offset, in number of characters, of
the first character of stringToFind from the beginning of stringToSearch. If
stringToFind is not contained within stringToSearch, AppleScript returns the
value 0.
EXAMPLES
offset of "yours" in "yours, mine, and ours"
--result: 1
offset of "mine" in "yours, mine, and ours"
--result: 8
offset of "this" in "yours, mine, and ours"
--result: 0
offset of "Mine" in "yours, mine, and ours"
--result: 0, due to case sensitivity
NOTES
The Offset command compares strings character by character, as the Equals
operator does, except that the Offset command is always case-sensitive, always
considers diacritical marks, and is not affected by Considering or Ignoring
statements.