First post, by emendelson
For anyone who wants to print from DOSBox under OS X, I've prepared a workaround that makes it possible to do so, although it's a bit of a kludge.
Download the ZIP file in the link at the bottom of this post. Extract the folder action script (it's an application bundle, not a simple script) and move it your ~/Library/Folder Action Scripts folder. Then right-click on an OS X folder that is accessible from DOSBox because it is inside the folder that you mount in DOSBox - or, for the greatest flexibility, right-click on any folder that you mount as the root directory of a drive in DOSBox. From the contextual menu choose Setup Folder Actions or some similar name (depends on OS version), and attach DOSBoxPrinting to the folder.
Now start up DOSBox. The instructions below assume that you attached the folder action to C:\ (the root directory of the mounted C:\ drive), but it can be any other directory accessible to DOSBox.
If your application can print to a file, then do one of the following:
1. If your application supports PCL, then set the output printfile to something like C:\OUTPUT.PCL or any other filename in C:\ with a .PCL extension. (The folder action script contains a copy that I compiled of GhostPCL, which the script uses to convert PCL to PS, which is then printed by the lpr command to the default printer).
2. If your application supports PostScript, then set the output printfile to something like C:\OUTPUT.PS or any other filename in C:\ with a .PS extension. (The folder action script uses lpr to print the file to your default printer.)
3. If your application prints ASCII text output only, set the output printfile to something like C:\OUTPUT.TMP or any other filename in C:\ with a .TMP extension. (The folder action script uses lpr to print the file to your default printer.)
4. If your application prints ASCII text, but does NOT support printing to a file, then try this (which works with EDIT.COM). In the field in your application where you enter a printer port (LPT1, COM1, etc.), enter: C:\@
and you should be able to print. This works because the script automatically prints any text file named "@" to the default printer.
Further notes: The printfile is deleted after printing, but files that are NOT named *.PCL, *.PS, *.TMP, or @ are ignored by the script.
If you want to see exactly what the script does (a reasonable thing to want), open it in your Applescript Editor application to see the script, and right-click on it and choose Show Package Contents to see the enclosed files.
The script requires OS X 10.6 or later for PCL printing; if anyone wants it, I can replace it with a version that works with 10.4 or 10.5, but doesn't support "Dark Courier" as the 10.6+ version does.
Features not yet implemented (though I have these features working on a similar setup and can add them if anyone wants them):
1. The option to popup an OS X dialog in which you can select a printer. This would work by setting the output filename to "SELECT.PCL", "SELECT.PS", etc. I have this working on my WordPerfect for DOS under OS X system, and can add it here.
2. An option to print PCL directly to the default printer, if you know that the default printer supports PCL (like most HP LaserJets and laser printers from Brother, Canon, etc.). Again, I have this working on my WordPerfect system. The advantage of this is that all PCL commands in the original file get sent to the printer, including embedded PCL codes. In the existing system, these embedded codes get stripped out when the printer output is converted to PostScript before printing.
3. An option to create a PDF file in OS X from the PCL, PS, or text output files. Again, I have this working for PCL and PS on my WordPerfect system, and it would be easy to add support for text files.
Warning: if you want to print PCL output, you will need to have X11 software installed in OS X; under OS X 10.6 and 10.7, this is probably installed by default. Under 10.8 Mountain Lion, when it is released, you will need to install third-party X11 software; Mountain Lion itself will explain this when you try to print PCL output. X11 is not required for text or PostScript output.
The folder action script can be found here; this link will always link to the current version, and I'll post notices of any features that I might add.