0.2. Tips ________________________________________________________________ dataComet documentation. (Rev. 1/27/08) Copyright 1998 databeast, Inc. All Rights Reserved. This document has information on (select and use "Find..." to go to the section): Using dataComet The edit window "Enter" key Chat and Talk interaction ("Command-Return") Recording macros Editing and executing macros ("Shift-Enter") Reformatting web page text ___________________________________________________ Using dataComet ___________________________________________________ This document offers some pointers on using dataComet to get maximum productivity. dataComet is especially useful in managing sessions with UNIX hosts. These pointers also apply to other hosts, though the commands will differ under operating systems such as digital's VMS and IBM's VM and MVS. The key to minimizing time and effort using dataComet is using the edit window and macro features. Host commands are sometimes complex and obscure; dataComet allows you to save complicated host commands or shell scripts in an edit window and execute them by selecting them and pressing the "Enter" key, which sends them to the host. (Commands which are one line long can be selected by placing the cursor anywhere on the line containing the command you wish to execute.) ___________________________________________________ The edit window "Enter" key ___________________________________________________ As a simple example, take the UNIX command which lists files by modification date: ls -lt After opening a session, you can execute the command above by bringing this window to the front, placing the cursor on the line containing "ls -lt", and pressing the "Enter" key. If you have multiple session windows open, the command will be sent to the frontmost window with an open connection. The value of saving these commands in an edit window becomes more obvious when you are executing more complex commands. For example, suppose you want to see a list of UNIX files sorted by size. The "ls" command doesn't have an option to sort by file size, so you need to "pipe" the output of the "ls" command into the "sort" command: ls -l | sort +3rn -4 Here's another example. Suppose you want to view a list of today's web hits without moving to the directory and using an editor: cat /home/www/logs/databeast.com/19`date +%y%m%d`.accesses (Note this example won't work for you unless you change the directory "/home/www/logs/databeast.com/" to the directory which contains your own web hit logs.) ___________________________________________________ Chat and Talk interaction ("Command-Return") ___________________________________________________ The "Command-Return" key is used like the "Enter" key in an edit window, with the simple difference that "Command-Return" adds a line break at the cursor position before sending the line to the host. This makes it easy to use "chat" and "talk" programs on the host. You can type a line to send in an edit window and then send it to the host with "Command-Return"; if you want to edit the line before sending it, you can change the line, and then send it using either "Enter" or "Command-Return". ___________________________________________________ Recording macros ___________________________________________________ You can use the "Macros" menu "Record actions for macro..." command to automatically record interactions with a host and generate a macro. When you're finished recording, select the "Record end--ready to Paste" command, and then Paste it into and edit window or the macro dialog. When you have a command working correctly, you can add a macro to execute the command if you use it frequently. To make a key macro, bring up the "Control Macro..." dialog (Command-D) and press the key you wish to remap. You can also add a global menu macro by using the "Macros" "Add Menu Macro..." command, or add a button macro by pressing on the button with the Option key held down. (See the document "4. Macros" for more information on adding macros and the commands available.) All macro editing uses the same basic dialog, which offers buttons to enter commonly used keys on the VT220 and IBM 3270 keyboard. ___________________________________________________ Editing and executing macros ("Shift-Enter") ___________________________________________________ After you've prepared a key macro using dataComet's "Record Actions for Macro..." command, you may want to edit it (especially on ASCII hosts, you will want to replace unnecessary "!D\002" two-second delays inserted by the automatic macro generator with "!D\000" delays (no delay). These delays are automatically inserted because some ASCII host applications present command prompts before they're ready to receive input, so the greater speed with which a macro executes may wind up sending a command to the application which the application will then drop, resulting in a failed macro. Only testing can tell whether a delay is adequate for a given host application. You use an edit window to modify and test macros to be sure they work reliably before placing them in a key, menu, or button by using the "Shift-Enter" key. This key works like the "Enter" key, but tells the emulator window which receives the text to interpret it as a macro. The "Command-Shift-Return" key functions in the same way, but breaks off the line before sending the text to the emulator window. ___________________________________________________ Reformatting web page text ___________________________________________________ Web browsers often copy text with lines broken at odd places, and sometimes present you with pages of offset text which, when copied, yield text which has leading spaces. Copies of these pages need to be reformatted when they are pasted into a Macintosh document. If you're copying text from a browser page and want to reformat it into a usable form using dataComet, you can do the following: copy the text in the browser, switch to a dataComet edit window, paste the text, strip the leading spaces and tabs, unwrap the text by deleting carriage returns, and edit it. After you switch to dataComet, you can use key commands for the remaining tasks: Shift-Command-N New text window Command-V Paste Command-Z Command-Z Undo twice to select Paste range Option-Shift-Command-[ Strip all leading spaces and tabs Shift-Command-/ Unwrap (strip Carriage Returns) If you use this command sequence frequently, you can execute it with a single keystroke by defining a key macro containing them (remember, it's easy to record different command sequences using "Record actions for macro"): !\001\065!\002\005!\002\001!\002\001!\002\173!\002\082 If you're preparing the text to be entered in a host editor, you can then: Shift-Command-= Resize window to 75 characters wide Command-/ Wrap (add Carriage Returns) Enter Paste through to the next frontmost session ________________________________________________________________