logo for MegaDots Duxbury Systems, Inc. logo logo for MegaDots

Chapter 19: MegaDots from the Command Line

Before we explain what you can do from the command line, we need to explain what the command line is. The command line is the same thing as the MS-DOS prompt, which is a text prompt that sits and waits for you to type in a command that it will recognize.

Do not use MegaDots from a full MS-DOS full screen, using the command line, if you have installed MegaDots answering "no" to the question about using MegaDots from the full DOS screen. If you are in this situation, only cannot have it both ways.

You can get into the command line by clicking on the Comamnd Line for MegaDots item in the Programs, Duxbury Group. If you do this, you will notice that the DOS window is full sized. This is appropriate for sighted persons. Blind persons using a speech program such as JAWS or Window-Eyes need to use the "window" sized screen. If the smaller screen is needed, right click on the icon, select properties, screen, and then click on the Window button (instead of full size).

To make good use of the command line, you need to add the MegaDots directory name to your path. There are various reasons why this was not done by the installation process.

If you have Windows NT, Windows 2000, or Windows 98 this is best done in the Control Panel, System, Advanced Settings, Environment Variables. Edit the Path to add your MegaDots directory name.

If You have Windows 95, Windows 98, or Windows ME, this is best done with a batch file.

To get into MegaDots from the command line, you just type mega <Enter>. This chapter explains what you can do besides just typing mega <Enter>, in order to capture the power of MegaDots from the command line.

Here are some of the things you can do at the command line:

If you know how to write batch files, you can add even more combinations and possibilities.

Information Displays

Use these options to get more information about how to use MegaDots at the command line. These do not actually load or execute the MegaDots program.

Type mega /? <Enter> to get a summary list of command line options. This displays information on the screen and then leaves you back at the command line.

Type mega /w <Enter> to list all the Word Processing code numbers (see below). This displays information on the screen and then leaves you back at the command line.

Plain Vanilla MegaDots

Type mega <Enter> to get into MegaDots without referencing any files. Use this if you do not want to open or import any files.

Loading MegaDots and One or More Files

Type mega [file name] <Enter> to open or import a particular file when you run MegaDots. MegaDots automatically recognizes dozens of word processor file formats and then does the appropriate file conversions to open the file in MegaDots. More than one file name is allowed, and the wildcards * and ? are allowed. Wildcards are symbols which stand for other characters. Asterisk stands for a variable number of characters (zero or more), and question mark stands for a single character. Typing mega dogs*.meg <Enter> opens all the MegaDots files starting with the letters DOGS.

You could type mega newsltr.meg jokes.txt <Enter> to load both of these files into MegaDots. Notice that there is just a space between the file names. Once you are in MegaDots, use F8 to switch between the two documents.

Type mega x*.meg <Enter> to load all the files starting with X and using the MEG file extension in the current directory. Be careful about using wildcards--it is very easy to specify more files than MegaDots can load into memory at one time.

Changing the Access with /a

MegaDots can be customized to work with a large number of different access devices by just entering mega from the DOS command line with some slash codes. Notice there is a space before each forward slash. Here are some choices:

Saving Preferences as Default with /f

Once you use these slash codes, the /f causes MegaDots to remember these settings in your preferences. From now on, you can just type mega <Enter> to launch MegaDots and it will be customized with the settings you saved. Once you get comfortable with MegaDots, you can further refine the user interface to meet your needs. See Chapter 5 and chapter 13 for the details.

Choosing Another Preferences File with /e

Type /e[preferences file] to run MegaDots with a specific preferences file. (The e stands for environment.) If your system has multiple users with different needs, you can save the different preferences files under their initials. For example, you could store sighted preferences in dh.env and blind preferences in cn.env. To run MegaDots with the sighted preferences, just add /edh to the command line. Notice that there is no space after the slash e, and that you do not include the .env filename extension.

Influencing the File Importation

When you import a file, MegaDots usually does the right thing. It automatically recognizes the format and builds an appropriate MegaDots file. However, MegaDots is not omnipotent, and sometimes it needs further human guidance about the format and function of a file.

If you have a file that is a list (perhaps a mailing list), MegaDots usually mangles the format. Type -list after the file name when you import the file (make sure there is a space before the hyphen). All your blank lines will be preserved, and MegaDots will mark each paragraph as List style.

If you have a file that is a listing of a computer program, you need to tell MegaDots to use the CBC (Computer Braille Code) translator for the entire document. Type -cbc after the file name when you import the file. All your blank lines are still there, and MegaDots marks each paragraph as Computer style.

If your file contains a lot of tabs, it may import poorly. The importer thinks that lines containing multiple tabs are part of a table. This can be a major problem. Type -notabs after the file name in the command line to suppress this interpretation of tabs.

Type mega [file name] -? at the command line to run MegaDots and import the specified file using a specific file conversion. MegaDots presents a list of file formats from which you select the one you want. Use this option only if you are not satisfied with the file conversion that MegaDots chooses automatically.

Combining Files with /c

What if you wanted to combine all the files of the MegaDots Manual into one big file? Just type: mega chap*.meg /c <Enter> (the slash c means combine all the files). The new file has the file name of the first file.

Saving or Exporting with /s

You can save files as MegaDots files or as word processor files from the DOS command line. Just type: mega article.txt /snewsltr.meg <Enter> to save as a MegaDots file. Type: mega article.txt /snewsltr.htm#9906 <Enter> to save as a web (html) file. In this last example, the number sign is followed by a four digit code for HTML (the complete list is in the MegaDots Command Summary).

Influencing Braille Translation with /t

When you import a file, MegaDots uses the translation parameters you have specified in your preferences. Sometimes, you may want to change these for one document. Let's say you want to translate a file into grade one braille. You can enter mega [file name] /to in the command line. The slash t means you are changing the Default Translation Method. Check out this option in the Translation Screen of the New Document Preferences. If there is a second letter after the t, it is for the Braille standard. If you want a Spanish document translated into grade one braille, enter /tos in the command line (s for Spanish).

Run a Macro with /k

You can also run a macro from the DOS command line using the /k (forward slash k). If you want to exit the Editor with your macro, you need to manually add Alt-X <Enter> to the end of the macro file.

MegaDots Quick Mode with /q

Most braille translation programs work directly from the command line. You tell your braille translator to translate a file and then produce it in braille. While MegaDots does have an editing environment, it also lets you produce inkprint or braille completely from the command line. This lets you make your own batch files to take a file and produce braille in one easy step. (A batch file is a file containing commands you can give at the command line to further automate the work you do.)

Type mega [file name] /b /q to open or import the file in MegaDots, convert to braille, and then output directly to your default brailling device. After brailling is over, you are returned to the DOS command line. The slash b means translate this into braille, and the slash q means and directly output to the default braille device.

You can use all the other options described in this chapter. You can reference multiple files, combine files, specify an environment file, or modify the file importation or translation. You can also specify a range of pages, for example if you want to resume where embossing left off in the middle of a document.

Specify a Port or File Name with Quick Mode

The slash q has a series of modifiers so that you can further manipulate the output. You can add a port or file name directly after the slash q (i.e., no space after the q). For example, mega article.txt /b /qarticle.brf creates a braille ready file from the article.txt file. Or to send the braille to a device attached to the second serial port you could type mega article.txt /b /qcom2.

You can run several files in a row through MegaDots in Quick Mode. For example, you could type mega apple.doc ibm.doc amiga.doc /b /q <Enter> to import, translate and output three different files. In this example, the page numbering would start over with each new file. If needed, a plus sign right after the Q makes page numbering continue from one file to the next.

Specify the Carriage Width with Quick Mode

What if you want to define the carriage width? You can do that from the command line as well. Add a number sign followed by the carriage width you want after the port or device name. For example, type as follows: mega pre.meg chap1.meg chap2.meg chap3.meg /b /q+com1#32 <Enter>. This takes several files, translates them, and outputs through com1 with a carriage width of 32. Of course you do not have to combine the use of the plus sign and the number sign.

Specify a Range of Pages with /r

When you print from the command line in Quick Mode, you can specify a range of pages. This is useful if you need to resume printing in the middle of a document.

To start printing on page [start#] and terminate on page [end#], add /r[start#]~[end#]. If you want printing to continue to the end of the document, use a very high number for [endble], such as 9999. If your document uses the Textbk Style Sheet with inkprint page indicators, use braille page numbers to specify the range of pages, and not inkprint page indicators.

If brailling of the file web.doc stopped on page 73, you could continue with mega web.doc /b /q /r73~9999.

Quick Mode for Inkprint

What about inkprint? You can output inkprint the same way. Just substitute slash i (for inkprint) instead of the slash b (for braille) to generate inkprint output. For example, type mega article.doc /i /q <Enter> to open or import the file in MegaDots, then convert to inkprint, and then output directly to your inkprint device.

Other Command Line Programs that Come with MegaDots

In your MegaDots directory, there are several useful programs that you can run from the DOS command line. These are listed here in alphabetic order.

bkeys

In order to use the MegaDots braille keyboard driver, you must run bkeysDRV. Usually this is set up automatically by the MegaDots Install program.

bkeys is a program that switches six key keyboard entry on or off manually from the command line. It is useful if you wish to use six key entry in DOS or in software other than MegaDots.

Type bkeys /o <Enter> to turn six key entry on. Type bkeys /x <Enter> to turn six key entry off. If an incompatibility arises with software after you have turned bkeys on, simply type bkeys <Enter> at the DOS prompt. This deactivates it, which is different than just turning it off.

global

This global replace program is used by MegaDots for importing and exporting special file formats. But feel free to use it for other applications. Unlike the global replace built into the MegaDots Editor, global works on ASCII textfiles. global is a useful general purpose utility for changing textfiles based on a specific list of replacements. You may find global useful to remove or alter things in an ASCII textfile which would confuse MegaDots.

For example, you can replace all occurrences of Pepsi with Coke, or all occurrences of the form feed character with nothing at all. To use global, just type global [input file] [output file] <Enter>. You are prompted for whether you have a rules file stored on disk. Answer No. Now you are prompted for find and replace strings. List the changes you want to make. When you are done just press Enter at the from prompt, and global will execute the changes.

It is very common to want to change the pattern of control characters in a file. There are two ways to specify control characters. Press Control-V (V for verbatim) followed by the control character you want to specify. Or you can press a tilde (~) followed by the specification in hexadecimal. For example, form feed is ~0C, carriage return is ~0D, and line feed is ~0A.

You can save a collection of changes in a rules file. In a rules file, there is a line for each replacement. The from string is separated from the to string by a vertical bar. To see what a rules file looks like, examine the file html.rul that comes with MegaDots. This is a rules file which translates MegaDots format commands into HTML format commands.

You can also run global at the command line referencing an existing rules file. For example, you could type: global map.txt guide.txt route.rul <Enter>. This would make a new file, guide.txt based on map.txt and the list of rules in route.rul. In this example, the rules file route.rul must be in the current directory.

global makes a clicking noise for each replacement it makes, and announces the total number of replacements when it is finished. If you would like to suppress these, add a space slash S (S for silent) to the end of the command string.

LOOKSS

LOOKSS gives you a data dump of MegaDots formatting. LOOKSS "decodes" the style sheet, to let you find out the information stored within it. To use LOOKSS, first change your current directory to the MegaDots directory (this is usually C:\mega25).

The command LOOKSS LITERARY will do a screen dump of all the styles in your literary style sheet. Displaying this much information without pauses is too difficult to read (unless you have been taking a speed reading course and can read 5000 words a minute).

To read one screenful at a time, type: LOOKSS LITERARY |MORE <Enter>. To direct the output to a file instead, type LOOKSS LITERARY >LITERARY.txt <Enter>. To use a parallel printer, type LOOKSS LITERARY >LPT1 <Enter>. To use a serial printer, type LOOKSS LITERARY >com1 <Enter>.

MAGNIFY

MAGNIFY enlarges the letters on the screen. To minimize scrolling problems, it puts 80 characters across, and 12 characters high. This is the same as the Tall screen mode in MegaDots. You may find it useful to do some of your DOS operations with MAGNIFY.

TINYTEST

MegaDots contains a program called TINYTEST to test output to an embosser. To use it, type TINYTEST LPT1 <Enter> at the command line. The parameter is the port name (substitute com1 or com2 as appropriate). This produces a framed braille pattern on the embosser and displays the dot pattern on the screen. If you are getting the same dot pattern on the screen as is on the embosser, then your embosser is able to print small files correctly.

view

View displays a braille ready file on the screen to make it easier to read. If MegaDots creates a braille ready file, and you want to check it out, use view to verify the layout of your output file.

To use view with the file article.brf, type in the following: view article.brf <Enter>. You get a display on the screen that shows the first page of braille on the left side of the screen. The right side of the screen gives a cheat sheet to help you recognize the grade two contractions. Pressing Up Arrow or Page Up takes you back a page, pressing Escape exits the program, and any other key advances one page.

where

Where locates files on your hard drive. For example, typing where resume.txt <Enter>, would initiate a search across all directories and subdirectories and report each and every occurrence of that filename. You can also do more general searches by using the wildcards ? and *. Typing where resume.* <Enter> might find files called resume.txt, resume.meg or resume.old.