The standard "context" variable that is passed to all JavaScript actions is a TextActionContext object, with the following properties and methods.
Returns an array of Range objects.
Setting this property will immediately update the selected ranges in the document.
Returns the string in the document represented by the Range range.
For instance, if you wanted to grab the first ten characters in a document you would do it like so:
actions.performWithContext(context, outError) {
var range = new Range(0, 10);
var firstTen = context.substringWithRange(range);
};
Returns true or false; whether the CETextRecipe recipe was successfully applied to the document.
options is an optional argument that specifies formatting settings for your recipe. Available values are 0 (for no formatting) or a formatting constant.
Returns true or false; whether the CETextSnippet snippet was successfully inserted in the document.
options is an optional argument that specifies formatting settings for your snippet. Available values are 0 (for no formatting) or a formatting constant.