On Friday, August 15, 2003, at 05:41 AM, Jonathan Levi, M.D. wrote:
Here's a possible approach: write an AppleScript droplet on which you drop a NWEx RTF file containing chemical formulas; the AppleScript sends the file to a Unix shell script (sed, perl, etc) which sniffs out the formulas, encloses digits found therein in \sub-\nosupersub RTF tags (makes them subscript), outputs a new file and has NWEx open the new file. To do it this way, I believe you'd need to have the Apple Developer Tools (free but many megabytes) installed on your computer. If there's a way within NWEx to bet the RTF to the Perl engine, then it could be done as a NWEx macro without the Developer Tools, but I haven't done anything with this approach. On the other hand, if a version of sed or perl comes with Jaguar routinely, then one wouldn't need anything else. Feel free to send me a short file or two privately, if you wish.
You need neither AppleScript nor Development Tools to do that. A Perl macro for NW-Ex can do it most normally: there is the "directive" that says "Send Text as RTF", which sends all the rtf data of a file to Perl. And the Perl macro is possible, because Perl is installed in /usr/bin/ by default. -- But still, you must be able to "sniff out the formulas" with enough accuracy, and also I think this approach is not practical at all. The Classic NW macro was useful because you could run it with a simple keyboard shortcut any time you wanted as you were writing your text. With this approach, you should have finished all your editing before running this macro.
Another possible approach would be to run a macro (probably a Perl macro) that inserts <sub>[any_digit]</sub> tags as you write your text, and then, when you have finished your editing, run another macro which would replace these tags with rtf code. This would not be very satisfactory visually, but would be interesting, because it would be very similar to the html or xml editing method.
Best regards,
Nobumi Iyanaga Tokyo, Japan
--------------------------------------------------- The Nisus Interactive List [EMAIL PROTECTED]
Searchable archives: http://www.mail-archive.com/nisus-interactive%40nisus.com/
To unsubscribe from this list please send a message with "unsubscribe nisus-interactive" in the body of the email to [EMAIL PROTECTED]
