XText is a wrapper object of AppleScript's text object. XText provides object oriented interface to manipulate text and some advanced features.
XText is a wrapper object of AppleScript's text object to provide object oriented interface to manipulate text. You can describe complex text handlings with simple statements.
The parent of instances of XText is AppleScript's text object. Therefore ...Properties of AppleScript's text can be obtained form a XText instance in same way to normal AppleScript's text object (string and Unicode text).e.g., length of a_text, word 1 of a_textAn instance of XText is immutable like string or Unicode class object.
There are same purpose methods in the both of class methods and instance methods (e.g., repace, split and so on). But there are folloing differeces.
Store current AppleScript's text item delimiters to prepare to call text handling routines.
Restore a AppleScript's text item delimiters stored by previous store_delimiters()
Make a list with splitting a text with specified delimiter.
Join a list of text with specified delimiter into a text.
Remove white spaces and new line characters (space, tab, return, line feed, BEL) placed at beginning and ending of a text.
Remove white spaces and new line characters (space, tab, return, line feed, BEL) placed at beginning of a text.
Remove white spaces and new line characters (space, tab, return, line feed, BEL) placed at endding of a text.
Replace words of "$1", "$2"... in a_text with item 1 of a_list, item 2 of a_list ...
It is useful to format a message to display.
Generate formatted text using printf command.
make a XText instance with given an AppleScript's text
Appending a passed text
Prepending a passed text
Replacing sub-text
Replacing sub-text in specefied range.
Output with inserting texts into the template
Remove white spaces and new line characters (space, tab, return, line feed) placed at the beginning and the endding.
Remove white spaces and new line characters (space, tab, return, line feed) placed at the beginning.
Remove white spaces and new line characters (space, tab, return, line feed) placed at the endding.
If the contents of the XText starts with a given text, ture is returned
If the contents of the XText ends with a given text, ture is returned
If the contents of the XText includes a given text, ture is returned
If the contents of the XText is equal to a given text, ture is returned
Obtain the position of passed text.
Obtain a character at specified index
Obtain a word at specified index
Obtain a paragraph at specified index
Obtain a text in a specified range of indexes
Make a XList instance of which elements are text items splitted with a specified delimiter
Make a list of which elements are text items splitted with a specified delimiter
Obtain contents of the XText instance with Unicode text class
A synonym of as_text.
Obtain contents of the XText instance with string class
logging contents of the XText instance