NOTEPAD SORT HACK

Problem: There is no easy way to alpha sort lines of text within the
note field of a Notepad record.

I asked for help on this problem from members of HPLX-L and got lots of
good suggestions. The best one came from palmtop guru, Jorgen Wallgren.
It relies on two other programs to create the solution. EXMBATCH by Rod
Whitby allows you to run a DOS program from a custom EXM program.
ADDKEYS by Dave Vickers records a series of keystrokes and plays them
back via a COM file it creates. The solution also requires SORT.EXE
which is part of DOS 5.0, but is not included on the HPLX. Finally, the
whole process is controlled by two system macros.

Files in this archive:

NOTES.MAC       A system macro file containing the two macros
SORT.EXE        Sort utility from DOS 5.0 full distribution
SORTNOTE.COM    The ADDKEYS keystroke playback COM file
SORTNOTE.EXM    The EXMBATCH EXM that runs SORTNOTE.COM

How it works:

Macro 1

1) Opens the Notepad record's note field using F3
2) Exports the field text to C:\TOSORT.TXT
3) Closes record
4) Switches to Application Manager
5) Runs SORTNOTE.EXM (which drops to DOS and runs SORTNOTE.COM)

SORTNOTE.COM

1) Selects the C: drive
2) Goes to the root of C: (CD \)
3) Sorts TOSORT.TXT: SORT < TOSORT.TXT > SORTED.TXT
4) Deletes TOSORT.TXT
5) Types EXIT to return to System Manager
6) Types Ctrl-Memo to go to Notepad
7) Types Fn-F2 to run Macro 2

Macro 2

1) Reopens notes field of same record
2) Clears old text with F;
3) Inserts the text from C:\SORTED.TXT
4) Closes record

How to install:

Place SORT.EXE, SORTNOTE.COM and SORTNOTE.EXM in a directory that
resides in your path. Install SORTNOTE.EXM to MOREEXM or to Application
Manager using the Ctrl-F3 hotkey combination. If you need to use
another hotkey combination, make sure and change Macro 1 to reflect
your choice. Put the macros from NOTES.MAC into a macro file, but make
sure to put Macro 2 in macro slot 2. If it is not there, SORTNOTE.COM
will not call it. If you run Buddy and use the automatic macro file
loading feature, you can just copy NOTES.MAC to your macro file
directory or add these two macros to your existing NOTES.MAC file. The
restriction on Macro 2's location still applies.

How to run:

1) Open Notepad
2) Cursor down to the note whose notes field you want to sort.
3) Start Macro 1

Additional information:

EXMBATCH - http://members.xoom.com/rwhitby/exmbatch.html
ADDKEYS - http://www.palmtop.net/super.html

EXMBATCH and ADDKEYS are copyrighted freeware. SORT.EXE is part of
MS-DOS 5.0, copyright The Microsoft Corporation. Please back up your
data before trying this. I cannot be responsible for anything this
little solution does to your beloved palmtop. It works great for me!

Mitch Hamm <mitch@palmtop.net>
http://www.palmtop.net
01/18/99