Character Offsets

Character offsets — When scripting NoteCase Pro, two numerical character counts indicating a range between two character positions in a note's content are referred to collectively as the range's character offsets. The character offset values are used for scripted actions such as getting the text a user has selected, inserting text in a particular position, etc. In the notation for scriptable program command documentation, character offsets are referred to as nFrom and nTo values or parameters. Learn more: Cursor Position, Getting and Setting.

When using NoteCase Pro scriptable program commands, a note's beginning has offset 0 and its last character is equal to the return of Nc_Note_Content_GetSize() -1. When using Lua methods, the first character in a string has offset 1 with the last character in the string having offset -1, with each character preceding the last character being identified by incrementing -1 by 1 (e.g., the next-to-last character is -2).