TextEditor(1) TextEditor(1)NAME TextEditor - mouse-based text editor SYNOPSIS TextEditor [filename] DESCRIPTION TextEditor is a mouse-based editor for use with both Macintosh(Reg.) and A/UX(Reg.) files of type TEXT. It runs with A/UX 2.0 and later systems. TextEditor provides an al- ternative to the vi and ed text editors for those who prefer to work with the mouse and pull-down menus instead of with keyboard commands. You can invoke TextEditor by double-clicking its icon, by double-clicking the icon of a Macintosh or A/UX text file while TextEditor is the default editor, or by entering launch TextEditor in the A/UX command line. For information about making TextEditor the default editor, see A/UX Essen- tials . If you double-click a file icon or specify a filename when invoking TextEditor from the command line, the text of that file appears in the first window displayed; otherwise, the first window is empty. TextEditor lets you open several windows at once, each displaying text from a different file; however, you can work in only one window at a time. The window in which you are working is called the active window. You can scroll and page the text in the active window by us- ing the scroll bar that runs along its right side, as described in A/UX Essentials . Files created or touched by TextEditor are saved as text- only files of type TEXT. They may contain tab and newline characters but no other formatting information. This file structure is compatible with other applications that create text-only files; for example, TextEditor can process MacWrite(Reg.) files saved with the Text Only option. The tab setting, font setting, selection, window settings, auto-indent state, invisible character state, and markers applicable to a file are saved with the file in its resource fork. This resource fork appears as a file named %filename in the A/UX directory that contains the primary file. You can tell TextEditor not to save this resource file by click- ing the ``Save Text Only'' radio button in the dialog that appears when you select any of the following items from the File menu: New, Close, Save as..., and Save a Copy. April, 1990 1
TextEditor(1) TextEditor(1)MOUSE-BASED EDITING In TextEditor, the procedure for inserting text entered from the keyboard is simple. Move the mouse so that you position the I-beam pointer on the screen at any place in the text inside the text window and then click (press and release) the mouse button. When you click, a blinking vertical bar appears at the pointer position to mark the current text insertion point. Characters you enter from the keyboard al- ways appear at this insertion point. At any time you can move the pointer to a new place in the text and click to es- tablish a new insertion point. Caution: Except for tab and newline, TextEditor ignores zero-width (control) characters generated by the keyboard. If you need to enter such a character into a document, gen- erate it in the Key Caps desk accessory (accessible under the Apple(Reg.) menu) and use Copy and Paste menu items in the Edit menu to transfer it to the document. The general procedure for using TextEditor to edit or other- wise modify existing text comprises two steps: first you select the text to be changed and then you choose the opera- tion you want to perform on the selection. If you select text and immediately enter one or more charac- ters from the keyboard, instead of choosing a menu item, TextEditor deletes the selected text and inserts the text entered from the keyboard in its place. In many cases, TextEditor lets you undo an operation if you make a mistake. Just choose Undo from the Edit menu immedi- ately after the faulty operation. The next section ``Text Selection'' tells you how to select the text to be edited; ``Menu Commands'' lists the opera- tions you can perform. TEXT SELECTION There are several ways you can select a section of existing text for a TextEditor editing operation. Double-clicking When you position the pointer on a word and press the mouse button twice in rapid succession, TextEditor selects that word. This is called double-clicking. In this selection mode, TextEditor recognizes two character domains. One domain contains the uppercase and lowercase letters, the ten numerals, and the underscore character; the other domain contains all other characters, including punctuation, space, and newline. If you double-click a character from the letter domain, TextEditor selects text in both directions from that character to the first character belonging to the 2 April, 1990
TextEditor(1) TextEditor(1)punctuation domain. If you double-click on a punctuation character, except for one of the enclosing characters described below, it selects just that character. Triple-Clicking When you place the cursor anywhere within a line of text and click the mouse button three times in rapid succession, TextEditor selects the entire line. This is called ``triple-clicking.'' Dragging When you move the pointer over text from one place to anoth- er while pressing and holding down the mouse button, TextEd- itor selects all the text the pointer passes over until you release the mouse button. This is called dragging. By dragging, you can select any amount of text from a single character to an entire document. When you attempt to move the pointer above or below the text currently showing, Text- Editor automatically scrolls the window to show more text. Shift Selection When you move the pointer to a place other than the current insertion point and then click while holding down SHIFT, TextEditor selects all the text between the insertion point and the pointer position, even when they are on different pages of the document and the insertion point is not show- ing. Marker Selection ``Mark Menu'' in the later section, ``Menu Commands'' describes how you can create names for selections of text. To select a piece of text you have previously named, you just choose its name from the Mark menu. Enclosed Text Selection When you double-click one of the following pairs of polar- ized enclosing characters, TextEditor selects all text between it and the matching character. These characters are: ( ) [ ] { } This method of selecting text works both backward and for- ward. For example, if you click a right bracket, TextEditor searches backward for the first preceding left bracket. It also correctly parses nested structures that use the same enclosing characters. When you double-click the first occurrence of one of the following pairs of nonpolarized enclosing characters, Text- Editor selects all text between it and the next occurrence of the same character forward in the text. These characters April, 1990 3
TextEditor(1) TextEditor(1)are: " " ' ' ` ` / / \ \ When making a selection from both polarized and nonpolarized enclosing characters, TextEditor ignores all characters ex- cept the correct match and searches to the beginning or end of the document. The resulting selection does not include the enclosing characters themselves. If TextEditor does not find a match, it selects only the character originally clicked. MENU ITEMS TextEditor displays menus titled File, Edit, Find, Mark, and Window in the menu bar at the top of the screen, plus the Apple menu at the far left. To choose a menu item, position the pointer on a menu title, press the mouse button, and move the mouse downward while holding down the mouse button. Release the button when the pointer has highlighted the desired item. Menu actions operate only on the active (frontmost or topmost) window. Many menu actions can be invoked from the keyboard by hold- ing down COMMAND (not CONTROL) and typing a character. The character required is shown beside the Command-key symbol in the menu display. Such Command-key equivalents may be en- tered as lowercase; you don't need to hold down SHIFT as well. The following sections describe the actions performed by the various TextEditor menu items. Apple Menu At the far left of the menu bar, the Apple symbol is the ti- tle of a menu that contains the About TextEditor menu item. Choosing that menu item displays a dialog box that gives version information. File Menu The menu items in the File menu let you create, retrieve, and save files, print text, and quit TextEditor. The File Menu contains the following menu items: New... Create a new empty file of type TEXT. This menu item first displays a dialog box that lets you enter a filename and select a direc- tory to contain the document. When you click the Drive button in this dialog box, TextEdi- tor searches for a different hard disk or floppy disk. When you click the New button, it creates the file and opens it in a new, 4 April, 1990
TextEditor(1) TextEditor(1)active TextEditor window. The Command-key equivalent for the New menu item is COMMAND- N. The New... dialog also contains radio buttons that let you specify whether the resulting file will be saved with its formatting infor- mation or as text only. Open... Open an existing text file from disk. This menu action first displays a hierarchical list of all files of type TEXT that are available in your immediate system. To open a file, double-click its name, or select its name and then click the Open button. When you open a file for the first time, TextEdi- tor places the insertion point at the begin- ning of the text. When you open the file subsequently, it appears in the last state in which TextEditor saved it; the previous selection or insertion point is preserved (if you have saved formatting information) unless the file has been modified by other software. To open a nonmodifiable copy of a file, click the Read-Only box. If the file you specify is already open in TextEditor, its window is made active. The Command-key equivalent for the Open menu item is COMMAND-O. Close Close the active window and remove it from view. You can recall the window later by us- ing the Window menu. This menu action does not save the window contents to disk. The Command-key equivalent for the Close menu item is COMMAND-W. If you have not previously saved the file, this menu action displays a dialog that lets you specify whether the file being closed will be saved, and if it is saved whether it is with formatting information or as text only. Save Save the contents of the active window to disk in the file that was originally opened, without closing the window. This menu item is grayed if the contents of the file have not been changed since the last Save action. The Command-key equivalent for the Save menu item is COMMAND-S. Save As... Save the contents of the active window to April, 1990 5
TextEditor(1) TextEditor(1)disk into a different file than the one ori- ginally opened, and start to edit the new file. The original file is closed with its original name but without any new changes be- ing saved to it. This menu action displays a dialog box that lets you enter the new filename and specify its directory location, as well as radio buttons that let you specify whether or not formatting information is saved. The active window then shows the name and contents of the new file and subsequent Save actions save the contents of the window to it. Save a Copy... Act the same as Save As, but continue editing the original file under the original name. Revert to Saved Discard all changes to the contents of the active window since it was last saved. This menu item is grayed if the contents of the file have not been changed since the last Save action. Page Setup Display a dialog box that lets you set the paper size, orientation, and reduction or en- largement for subsequent printing actions. Print Window Print text from the active window. If part of the text is currently selected, TextEditor prints only the selection; otherwise, it prints the entire document in the window. Use the Chooser desk accessory, available in the Apple menu, to specify which printer to use. Use the Page Setup menu item, just described, to specify paper size, orienta- tion, and scale. Quit Exit TextEditor and return to the Finder. If there are unsaved changes to any files, Text- Editor gives you a chance to save them. The Command-key equivalent for the Quit menu item is COMMAND-Q. Edit Menu The items in the Edit menu help you move text around and perform certain global formatting actions. Undo Reverse the most recent text change. If you choose Undo a second time, the change is rein- stated. This menu action does not affect changes to the resource fork, such as font or 6 April, 1990
TextEditor(1) TextEditor(1)tab settings. The Command-key equivalent for the Undo menu item is COMMAND-Z. Cut Copy the currently selected text in the active window to the Clipboard and then delete it from the window. The Command-key equivalent for the Cut menu item is COMMAND-X. Copy Copy the currently selected text in the active window to the Clipboard without deleting it from the window. The Command-key equivalent for the Copy menu item is COMMAND-C. Paste Replace the currently selected text in the ac- tive window with the contents of the Clipboard. If there is no current selection, Paste inserts the contents of the clipboard at the current insertion point. The Command-key equivalent for the Paste menu item is COMMAND-V. Clear Delete the currently selected text from the ac- tive window. The key equivalent for the Clear menu item is DELETE. Select All Select the entire document that is in the active window. The Command-key equivalent for the Select All menu item is COMMAND-A. Show Clipboard Display a new, active TextEditor window that displays the contents of the Clipboard, if any. Format... Display a dialog box that lets you set typogra- phy and indentation for the entire document that is in the active window. Scrolling list (fields) in the Format dialog box let you select a type font and size for the ac- tive window by clicking items in the lists. The Auto Indent check box in the Format dialog box toggles auto-indenting on and off, with the X-mark indicating it is on. When auto-indenting is on, pressing RETURN aligns text to the left margin of the previous line. You can override auto-indenting for any single line, aligning it to the far left margin, by holding down OPTION while you press RETURN. The Show Invisibles check box in the Format dia- log box toggles invisible character display on and off, with the X-mark indicating it is on. April, 1990 7
TextEditor(1) TextEditor(1)When it is on, all characters in the document are displayed, including those normally invisi- ble. Tabs are shown as triangles, spaces as di- amonds, newlines as logical negation characters (rotated L's), and all other normally invisible characters as upside-down question marks. The Tabs text box in the Format dialog box lets you enter the number of spaces signified by each tab character in the active window. Align Align the left margin of all the currently selected text in the active window to the top line of the selection. Shift Left Move the currently selected text in the active window one tab distance to the left, preserving indentation within the selection. The Command- key equivalent for the Shift Left menu item is COMMAND-{. If you also hold down SHIFT, the movement becomes one space instead of one tab. Shift Right Perform the same action as Shift Left, but move the selection to the right. The Command-key equivalent for the Shift Right menu item is COMMAND-}. Find Menu The menu items in the Find menu help you find and replace text in the active window. All search actions start by displaying a dialog box that lets you specify the following options by clicking an option so the check box is checked: Literal Find the exact string you entered, wherev- er it may appear, even if it is part of another string. Entire Word Find the string you entered only if it constitutes an entire word. The determi- nation of word boundaries is the same as with double-clicking, described earlier in ``Text Selection.'' The Entire Word and Literal options are mutually exclusive. Case Sensitive Find the string you entered only if the uppercase and lowercase status of all letters in the found string is the same. Search Backward Search from the current selection or insertion point toward the beginning of 8 April, 1990
TextEditor(1) TextEditor(1)the document. You can temporarily reverse the direction of searching, either from forward to backward or from backward to forward, by holding down SHIFT when you start a search operation. Wrap-around Search Search forward to the end of the document, then start searching again from the begin- ning to the current selection or insertion point. If Search Backwards is also selected, Wrap-around Search does the same in the reverse direction. The default values for searching are Literal on, Entire Word off, Case Sensitive off, Search Backwards off, and Wrap- around Search off. Whenever a search fails, TextEditor tells you by sounding a beep. The Find menu contains the following menu items: Find... Find the next occurrence of the string you specify in the text box. TextEditor scrolls the active window to that part of the document and selects the text it has found. The Command-key equivalent for the Find menu item is COMMAND-F. Find Same Repeat the most recent Find operation. The Command-key equivalent for the Find Same menu item is COMMAND-G. Find Selection Find the next occurrence of the currently selected text. The Command-key equivalent for the Find Selection menu item is COMMAND-H. Display Selection Scroll the active window to show the currently selected text. Replace... Find the next occurrence of the string you specify in a text box and replace it with another string that you also specify. The Command-key equivalent for the Replace menu item is COMMAND-R. Replace Same Repeat the latest Replace operation. The Command-key equivalent for the Replace Same menu item is COMMAND-T. April, 1990 9
TextEditor(1) TextEditor(1)Mark Menu The menu items in the Mark menu help you navigate long docu- ments. They let you associate labels with pieces of text so you can find them easily later. They also make it easy to select large pieces of text, as explained earlier in ``Text Selection.'' The upper part of the Mark menu, above the horizontal line, contains the menu items Mark and Unmark; the lower part con- tains a list of all mark labels you have created for the currently active window. The Mark and Unmark menu items do the following: Mark... Display a dialog box that lets you attach a label to a text position. If you previously selected a piece of text, the label applies to the whole selection; if not, it applies to the current posi- tion of the insertion point. If you try to create a label using a name that is already taken, Text- Editor displays a dialog box that lets you either replace the old marker or choose a new name. The Command-key equivalent for the Mark menu item is COMMAND-M. Unmark... Display a dialog box that lets you remove unwanted markers. The Unmark dialog box shows you a scrol- ling list of all current markers. You can select one or more of them, by clicking or dragging, and then click the Delete button. If you decide you don't want to delete a marker, click the Cancel button. When you choose one of the label items in the lower part of the menu, TextEditor scrolls the active window to the marked text and either selects it (if you originally marked a selection) or places the insertion point at the marked posi- tion. Window Menu The menu items in the Window menu help you arrange and re- call TextEditor windows. The upper part of the Window menu, above the horizontal line, contains the menu items Tile Win- dows and Stack Windows; the lower part contains a list of the full pathnames of all windows currently displayed in TextEditor. The Tile Windows and Stack Windows menu items, in the top part of the Window menu, do the following: Tile Windows Arrange the currently open windows vertical- ly, so that at least part of the contents of each one is visible. 10 April, 1990
TextEditor(1) TextEditor(1)Stack Windows Arrange the currently open windows in a diag- onally staggered overlapping pattern, with the currently active window in front. The active window is the only one whose contents are visible. When you choose one of the items in the lower window list, TextEditor makes it the active window. The names of currently displayed windows are listed in the order they were originally displayed. In addition, they are marked as follows: Check mark The currently active window Round bullet The window that was active just before the currently active window, and hence is second to the front Underline Any window containing changes that have not yet been saved FILES /usr/toolboxbin/TextEditor /usr/toolboxbin/%TextEditor SEE ALSO vi(1), ed(1). See MPW 3.0 Reference for a description of a similarly con- structed mouse-based text editor. April, 1990 11