text
Format messages as a text file
Description
Collects and formats incoming messages as text to be output as lines of text.
Arguments
filename[symbol]
optional
Names a text file to be read in when the object is loaded.
Attributes
precision[int]
The number of decimal places for converted floating point values.
stringout[int]
Output Lines As String Object
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
int
float
list
anything
The message is stored in the text object, placed after any previously stored messages, and is followed by a space.
- input
[list]
clear
Erases the contents of text.
cr
(mouse)
Double-clicking with the mouse on the text object (when the patcher window is locked) opens an editing window in which the contents of text can be viewed and edited. The text object ignores messages to change its text while the editing window is open. Unlike the capture object, changes made in the editing window of text actually alter the contents of the object.
dump
The word text to send its contents out of the object's left outlet.
causes
filetype
The word text object. File types are specified using the standard four-letter filetype codes (e.g. filetype ffoo). The message with no arguments restores the default file behavior -- either Max binary or text file formats. File types are mapped to filename extensions on Windows based on the messages to max contained in the file max-fileformats.txt in the init folder, which is loaded on startup. If you are defining your own filetype, you may want to include your own text file in the init folder in order to specify a mapping between an extension and your four-letter type code.
, followed by a symbol, sets the file types which can be read and written into the- filetype-code (four letters)
[symbol]
line
The word text to send out the contents of that line number (up to 256 characters) with the word prepended (for setting the contents of a message box). Lines are numbered beginning with 1; any line number message less than 1 is converted to . If a nonexistent line number is requested, nothing is sent out.
, followed by a number, causes- index
[int]
open
Opens the object's text window for editing. Double-clicking on the text object in a locked patcher has the same effect. The text object ignores messages to change its text while the editing window is open. Unlike the capture object, changes made in the editing window of text actually alter the contents of the object. However, these changes will not be saved or communicated to the text object until the editing window is closed.
query
The word text object out the object's right outlet.
sends a number that specifies the number of lines stored in the
read
The word
, followed by a symbol that specifies a filename, will read the contents of a text file. If no filename or pathname is specified, the message will call up the standard Open Document dialog box, so that a text file can be specified. Use the filetype message to use a custom filetype with this object.- filename
[symbol]
settitle
The word
, followed by any word, sets the title of the text window. If you want more than one word to appear as the default text, you must enclose the words in double quotes or precede the spaces with a backslash ( ).- window-name
[symbol]
symbol
The word text. This is useful if you want to store a word that would otherwise be understood as a specific message by text. For example, stores the word , followed by a space, at the end of the contents of text, rather than erasing the contents.
, followed by any word, stores that word at the end of the contents of- any symbol
[symbol]
t_symbol
tab
wclose
Closes the window associated with the text object.
write
The word text as a text file in the current default folder unless the file is specified with an absolute pathname. If no filename or pathname is specified, the message will open up a standard Save As dialog box, so that the contents of text can be saved in a separate text file. Use the filetype message to use a custom filetype with this object.
Please note that changes to the text object will not be saved until the editing window is closed.
- filename
[symbol]
Output
bang
Out middle outlet: When a file has finished loading in response to a
message, a is sent out the middle outlet.int
Out right outlet: In response to a text object is sent out the right outlet.
message, a number corresponding to the number of lines of text stored in thesymbol
Out left outlet: When a message box (or can be sent to any other object for which that particular message is appropriate).
message is received, the text of the specified line number is sent out preceded by the word . The message can be used to set the contents of aSee Also
Name | Description |
---|---|
External Text Editor | External Text Editor |
capture | Store values to view or edit |
filein | Read and access a file of binary data |
itable | Data table editor |
spell | Convert input to UTF-8 (Unicode) codes |
sprintf | Format a message of words and numbers |
table | Store and edit an array of numbers |
textedit | Enter text |