; PineDump - Message downloader for Pine Mail - Chuck Spohr - 9/10/95 ;**************************************************************************** ;* * ;* PINEDUMP.WAS * ;* Copyright (C) 1995 Charles F. Spohr * ;* All rights reserved * ;* * ;* This PW 2.x script downloads Pine Mail messages to a file, and brings it * ;* up in the text editor for review. * ;* * ;* To install this script, copy PINEDUMP.WAS into your PROWIN2\ASPECT * ;* directory and compile it from the Script | Compile/Edit menu. PINDUMP * ;* should then appear in your script list on the toolbar. * ;* * ;* To use PINEDUMP, simply select it from the toolbar while you are viewing * ;* a message in pine, or while the message is selected in Pine's Folder * ;* Index. In short order, the script will capture the message to a file * ;* in your PROWIN2\CAPTURE directory, and display it in the default editor. * ;* The message is stored in a file called PINE0001.CAP, where the number * ;* increments for each subsequent capture. * ;* * ;* From the editor, you may save the message to a different filename, copy * ;* and paste, edit, print, or whatever else you like to do to E-mail * ;* messages! * ;* * ;* This file may be freely distributed as long as it is in its original * ;* form. You may use and modify this code for your own scripts, but you * ;* may not publish or distribute modified versions of this source code * ;* without permission. (I basically don't want to support a zillion * ;* homegrown mutations of this thing.) * ;* * ;* It wouldn't be complete without a disclaimer... * ;* * ;* This ASPECT SCRIPT is intended only as a sample of ASPECT programming. * ;* Charles Spohr makes no warranty of any kind, express or implied, * ;* including without limitation, any warranties of merchantability and/or * ;* fitness for a particular purpose. Use of this program is at your own * ;* risk. * ;* * ;* Now for a shameless advertisement: * ;* * ;* Chuck Spohr is a software consultant based in Austin, TX, specializing * ;* in communications and database programming. If you need help tackling * ;* that big project, drop him a line at: * ;* * ;* Chuck Spohr * ;* 11701 Metric Blvd #1018 * ;* Austin, TX 78758 * ;* * ;* (512) 836-1324 Voice * ;* 75557,2233 CompuServe * ;* 75557.2233@compuserve.com Internet * ;* * ;**************************************************************************** integer iExitFlag = 0 integer iHostPrint, iAutoStart, iOverWrite, iQuery, iRecordMode, iFileCount string szOldCapFile proc main string szMainCapPath, szCapPath, szCapFileName, szEditor, szEditCmd ; Make sure we're ready if $CARRIER transmit "Y" if not waitfor "?" 6 Instructions() endif else Instructions() endif ; Store current settings fetch terminal hostprint iHostPrint fetch capture file szOldCapFile fetch capture autostart iAutoStart fetch capture overwrite iOverWrite fetch capture query iQuery fetch capture recordmode iRecordMode ; Get the next filename fetch capture path szMainCapPath for iFileCount = 1 upto 9999 strfmt szCapFileName "PINE%04d.CAP" iFileCount szCapPath = szMainCapPath addfilename szCapPath szCapFileName if not findfirst szCapPath exitfor endif endfor ; Set up PW for capture set terminal hostprint DISABLE set capture file szCapFileName set capture autostart off set capture overwrite off set capture query off set capture recordmode filtered ; Set up WHEN targets when target 0 "^Z" call SetExitFlag when target 1 "^L" call SetExitFlag ; Do the capture transmit "Y" waitfor "`"]" capture on ; Wait until one of our WHEN targets arrives while ! iExitFlag yield endwhile capture off transmit "^L" ; Refresh the display ; Run the editor fetch editor szEditor strfmt szEditCmd "%s %s" szEditor szCapPath run szEditCmd ; Restore settings Cleanup() endproc proc SetExitFlag iExitFlag = 1 endproc proc Cleanup set terminal HostPrint iHostPrint set capture file szOldCapFile set capture autostart iAutoStart set capture overwrite iOverWrite set capture query iQuery set capture recordmode iRecordMode exit endproc proc Instructions sdlgmsgbox "PineDump" "PineDump Instructions:`n 1) Connect to host computer`n 2) Go into Pine Mail`n 3) View the message you wish to capture`n 4) Run PineDump from the Action Bar" INFORMATION OK i0 exit endproc