C:\Sistemp\SaveMail.opo!:\Psion5CD1\SaveMailER3forMacro5\SaveMail.opoC:\Sistemp\SaveMail.opl!:\Psion5CD1\SaveMailER3forMacro5\SaveMail.oplC:\Sistemp\SaveMail.ico!:\Psion5CD1\SaveMailER3forMacro5\SaveMail.icoC:\Sistemp\SaveMail.box!:\Psion5CD1\SaveMailER3forMacro5\SaveMail.boxC:\Sistemp\readme!:\Psion5CD1\SaveMailER3forMacro5\readmeC:\Sistemp\history!:\Psion5CD1\SaveMailER3forMacro5\historyC:\Sistemp\Bis.txt!:\Psion5CD1\SaveMailER3forMacro5\Bis.txtSaveMailER3forMacro5 45.6 kB7 $C:\Documents\OPL\Macros\SaveMail.opl EMAIL$ DATA$ EMAILRSC$ DATARSC$ MULTIBOX% USERDIALOG% DATEFORMAT& MACRONEW% TOTMSG& NUMMSG% NOSUBJ% DELMSG% PASTETOWORD% SKIP% TOTSKIP% DATE$ FROM$ SUBJECT$ BODY$ MACRO5TEST INISETUP% STARTEMAIL% GETFOCUS MULTIBOXPROC% USERDIALOGPROC% STARTDATA COPYFROMEMAIL ADJUSTDATE ADJUSTFIELDS PASTETOWORD PASTETODATA REPORT GETAPP$ EMAIL$ SaveMail+ v2.51 ER3K+%To be launched as a macro with Macro5W8 LIBVERSION% MACRONEW% MACRO5VER LIBVERSION% INIRESULT% MULTIBOXPROC% EMAIL$ EMAILRSC$ DATA$ DATARSC$ DATEFORMAT& MACRONEW% MULTIBOX% USERDIALOG% C:\System\SaveMail.iniW SaveMail+ v2.51 ER3K+ Sorry, I can't find Email.appW8 SaveMail.boxO Z:\System\Apps\Data\Data.rsc Z:\System\Apps\Data\Data.ruk SaveMail+ v2.51 ER3K+ Sorry, I can't find Data.rsc/rukW8 SaveMail+ Setup (step 1 of 3) ...K +)- your Email program is located on drive + - your System Date format is "mm yyyy"K + - your System Date format is "dd yyyy"K +"- your System Date format is "yyyy - your Macro5 version is S OdT|O +;- SaveMail is not tested with Macro5 versions prior to 2.37 CancelO ContinueO SaveMail+ Setup (step 3 of 3)K +)Each time you launch SaveMail you can ... +(1) have a choice of the target Data file +/2) open a dialog window to automate the process +'of storing/deleting a group of messages CancelO ContinueO C:\System\SaveMail.ini EMAIL$ EMAILRSC$ DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATEFORMAT& MACRONEW% EMAIL$' + EMAILRSC$' DATA$' DATARSC$' + MULTIBOX%$ USERDIALOG%$ DATEFORMAT&% + MACRONEW%$ C:\System\SaveMail.ini EMAIL$ EMAILRSC$ DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATEFORMAT& MACRONEW% EMAIL$# + EMAILRSC$# DATA$# DATARSC$# + MULTIBOX% USERDIALOG% DATEFORMAT&! + MACRONEW% SaveMail+ v2.51 ER3K +'Problem reading your SaveMail.ini file! Relaunch the Setup procedure? +"(you will loose your old settings) CancelO ContinueO C:\System\SaveMail.ini SaveMail+ v2.51 ER3K Setup aborted... Relaunch the macro to complete Setup successfully completed... Now you can relaunch the macro ContinueO FGAPP% SENDRSCMENU GETFOCUS MACRONEW% EMAIL$ EMAILRSC$ Opening Email, please wait ...O +)SaveMail has opened your Email program...+0Now highlight an Inbox/Sent message and relaunchW8 Opening Email, please wait... +$SaveMail is opening Email program...+,Highlight an Inbox/Sent message and relaunchW8 FGAPP% GETFOCUS MACRONEW% DATA$ EMAIL$ +$Opening MailBox file, please wait... INISETUP% NEWDATA% USEWORD% DATA$ C:\System\SaveMail.ini EMAIL$ EMAILRSC$ DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATEFORMAT& MACRONEW% DATA$# SaveMail+ v2.51 ER3KO +-Select the location of your target Data file: SaveMail+ Setup (step 2 of 3) ...K +6Select the location of your default Mailbox Data file: File,Folder,Disk( HO HO or choose ...+''New' to create a new Mailbox Data file ...+$'Word' to store to a Psion Word file ...+''Setup' to relaunch the Setup procedure NewON+ WordOW+ SetupOS+ CancelO ContinueO NewON+ CancelO ContinueO No target file selected SaveMail+ v2.51 ER3K Relaunch the Setup procedure? +%(you will loose the current settings) CancelO ContinueO C:\System\SaveMail.ini SaveMail.boxO Target file is MACROS$ DATA$ SaveMail.boxK SaveMail.boxO SaveMail+ v2.51 ER3K Create new MailBox Data file: File,Folder,DiskO Set as default CancelO ContinueO C:\System\SaveMail.ini EMAIL$ EMAILRSC$ DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATEFORMAT& MACRONEW% DATA$' NEW option not available SaveMail.boxO USEDOC% FGAPP% GETFOCUS DATA$ PASTETOWORD% EMAIL$ SaveMail+ v2.51 ER3K Select an existing Word file: File,Folder,Disk( HO HO or choose ...+ 'New' to create a new empty one NewON+ CancelO ContinueO No target file selected WordO SaveMail+ v2.51 ER3K Create a new Word file: File,Folder,DiskO CancelO ContinueO WordO TOTMSG& NOSUBJ% DELMSG% SaveMail+ v2.51 ER3K Number of messages to storeO +2(starting from the highlighted one and going down)( +"Highlighted message has no subject +/(this option forces one single message storing)( +"Delete original message from Email +4(use with care, don't forget to save attachments...)( CancelO ContinueO Please read carefully: +-You have chosen the "Auto-Delete" option, so: - DO NOT touch the keyboard and +$- DO NOT switch to any other program +6while the macro is running, as this could also lead to + the loss of all your messages...( +5A dialog box will inform you when the task has ended. DisableOD+ AbortO ContinueO Od@[0 "Auto-Delete" option disabled FGAPP% SENDKEY SENDRSCMENU COPY$ EMAIL$ EMAILRSC$ DATE$ SKIP% TOTSKIP% FROM$ SUBJECT$ BODY$ EnterO Fn+UpO Right,DownO Right,DownO Right,DownO Right,DownO Right,DownO Right,Fn+Down,Fn+DownO Ctrl+cO SKIP% DATEFORMAT& DATE$ SKIP% NOSUBJ% SUBJECT$ BODY$ < no subject > FGAPP% SENDRSCMENU SENDKEY PASTE DATA$ NUMMSG% DATARSC$ SKIP% FROM$ DATE$ SUBJECT$ TOTMSG& Tab,Tab,Tab,Tab,TabO Ctrl+vO + Shift+TabO + Shift+TabO + Shift+TabO + Shift+TabO + Shift+TabO FGAPP% SENDRSCMENU SENDKEY PASTE SKIP% DATA$ DATARSC$ SUBJECT$ DATE$ FROM$ Left,EnterO Ctrl+vO EnterO +(************ end of message ************O EnterO Left,EnterO EnterO * Subject: EnterO * Date: EnterO * From: EnterO * To: EnterO + * CC/BCC: EnterO * Body:O LeftO GETFOCUS SENDKEY FGAPP% SENDRSCBUTTON TOTMSG& NUMMSG% DELMSG% SKIP% EMAIL$ TOTSKIP% DATA$ SaveMail+ warningK +/Check if the last saved message contains one of +2the To/CC/BCC fields exceeding the 250 chars limit +1The message storing procedure has been stopped... +0The original message won't be deleted from Email ContinueO Message NOT stored Message of K B storedK New message stored hD\[= z:\System\Data\Eikon.rscO DownO SaveMail+ v2.51 ER3K Unable to store message(s)K( +# message(s) successfully stored to:K ContinueO MAIN9 MACRO5TESTw MACRO5VER INISETUP%< INIRESULT% STARTEMAIL% STARTDATA MULTIBOXPROC%0 NEWDATA% USEWORD% USERDIALOGPROC% COPYFROMEMAILy ADJUSTDATE ADJUSTFIELDS PASTETODATAp PASTETOWORD, REPORT SYSTINFO REM Macro SaveMail (for Epoc Release 3) REM To be used with Macro5 (from v2.37) REM and a Psion S5 or Geofox + MsgSuite Email (v1.52) REM by S.Alisi - sergioalisi@geocities.com REM http://www.geocities.com/siliconvalley/bridge/1492 INCLUDE "Systinfo.oxh" CONST AppName$="SaveMail" CONST AppVersion$=" v2.51 ER3" CONST DataUID&=&10000086 CONST WordUID&=&1000007F CONST EmailUID&=&10000162 CONST IniFile$="C:\System\SaveMail.ini" CONST SourceBoxName$="SaveMail.box" PROC Main: GLOBAL Email$(255),Data$(255) GLOBAL EmailRSC$(255),DataRSC$(255) GLOBAL MultiBox%,UserDialog%,DateFormat&,MacroNew% GLOBAL TotMsg&,NumMsg%,NoSubj%,DelMsg%,PasteToWord%,Skip%,TotSkip% GLOBAL Date$(30),From$(250),To$(250) GLOBAL CC$(250),BCC$(250),Subject$(250),Body$(250) Macro5Test: TotMsg&=1 :NumMsg%=1 if IniSetup%: :return :endif if StartEmail%: :return :endif GetFocus: if MultiBox% if MultiBoxProc%:(1) :return :endif endif if UserDialog% if UserDialogProc%: :return :endif endif StartData: while NumMsg%<=TotMsg& CopyFromEmail: AdjustDate: AdjustFields: if PasteToWord% PasteToWord: else PasteToData: endif Report: endwh PROC Macro5Test: rem check if SaveMail is launched from Macro5 and as a macro onerr No_Macro:: Email$=GetApp$:(EmailUID&) return No_Macro:: onerr off alert(AppName$+AppVersion$,"To be launched as a macro with Macro5") stop PROC Macro5Ver: rem check which version of Macro5 is currently installed onerr Old_Macro:: if LibVersion%: >=240 MacroNew%=-1 return endif Old_Macro:: onerr off MacroNew%=0 PROC IniSetup%: LOCAL s0%,s1%,s2%,s3% Start:: if not exist (IniFile$) if Email$="" alert(AppName$+AppVersion$,"Sorry, I can't find Email.app") return -1 endif EmailRSC$=Left$(Email$,Len(Email$)-3)+"rsc" Data$="*"+Right$(SourceBoxName$,4) DataRSC$="Z:\System\Apps\Data\Data.rsc" rem for Psion S5 if not exist (DataRSC$) DataRSC$="Z:\System\Apps\Data\Data.ruk" rem for Geofox if not exist (DataRSC$) alert(AppName$+AppVersion$,"Sorry, I can't find Data.rsc/ruk") return -1 endif endif rem the following line finds the Date Format of your machine SIDateFormat:(DateFormat&, s0%, s1%, s2%, s3%) dinit AppName$+" Setup (step 1 of 3) ..." dtext "","- your Email program is located on drive "+Left$(Email$,1) if DateFormat&=0 dtext "","- your System Date format is ""mm"+chr$(s1%)+"dd"+chr$(s2%)+"yyyy""" elseif DateFormat&=1 dtext "","- your System Date format is ""dd"+chr$(s1%)+"mm"+chr$(s2%)+"yyyy""" elseif DateFormat&=2 dtext "","- your System Date format is ""yyyy"+chr$(s1%)+"mm"+chr$(s2%)+"dd""" endif Macro5Ver: if MacroNew% dtext "","- your Macro5 version is "+gen$(LibVersion%:/100,2)+"."+right$(gen$(LibVersion%:,4),2) else dtext "","- SaveMail is not tested with Macro5 versions prior to 2.37" endif dbuttons "Cancel",27,"Continue",13 if dialog else IniResult%:(-1) return -1 endif if MultiBoxProc%:(0) IniResult%:(-1) return -1 endif dinit AppName$+" Setup (step 3 of 3)" dtext "","Each time you launch SaveMail you can ..." dcheckbox MultiBox%,"1) have a choice of the target Data file" dtext "","2) open a dialog window to automate the process" dcheckbox UserDialog%,"of storing/deleting a group of messages" dbuttons "Cancel",27,"Continue",13 if dialog else IniResult%:(-1) return -1 endif create IniFile$,a,Email$,EmailRSC$,Data$,DataRSC$,MultiBox%,UserDialog%,DateFormat&,MacroNew% a.Email$=Email$ a.EmailRSC$=EmailRSC$ a.Data$=Data$ a.DataRSC$=DataRSC$ a.MultiBox%=MultiBox% a.UserDialog%=UserDialog% a.DateFormat&=DateFormat& a.MacroNew%=MacroNew% append close IniResult%:(0) return -1 else onerr Wrong_ini:: open IniFile$,a,Email$,EmailRSC$,Data$,DataRSC$,MultiBox%,UserDialog%,DateFormat&,MacroNew% Email$=a.Email$ EmailRSC$=a.EmailRSC$ Data$=a.Data$ DataRSC$=a.DataRSC$ MultiBox%=a.MultiBox% UserDialog%=a.UserDialog% DateFormat&=a.DateFormat& MacroNew%=a.MacroNew% onerr off close endif return Wrong_ini:: dinit AppName$+AppVersion$ dtext "","Problem reading your SaveMail.ini file!" dtext "","Relaunch the Setup procedure?" dtext "","(you will loose your old settings)" dbuttons "Cancel",27,"Continue",13 if dialog delete IniFile$ goto Start:: else return -1 endif PROC IniResult%:(Type%) dinit AppName$+AppVersion$ if Type%=-1 rem Setup aborted dtext "","Setup aborted..." dtext "","Relaunch the macro to complete" else rem Setup completed dtext "","Setup successfully completed..." dtext "","Now you can relaunch the macro" endif dbuttons "Continue",13 dialog PROC StartEmail%: if MacroNew% rem Macro5 v2.40 or later installed busy "Opening Email, please wait ...",3,1 if (FgApp%:(Email$))=1 SendRscMenu:(EmailRSC$,4,&1008) rem switch to inbox ("Shift+Ctrl+i" for UK/USA) busy off GetFocus: alert("SaveMail has opened your Email program...","Now highlight an Inbox/Sent message and relaunch") return -1 endif busy off else rem Macro5 v2.37 installed if (FgApp%:(Email$))=1 GetFocus: giprint "Opening Email, please wait..." pause 90 SendRscMenu:(EmailRSC$,4,&1008) rem switch to inbox ("Shift+Ctrl+i" for UK/USA) alert("SaveMail is opening Email program...","Highlight an Inbox/Sent message and relaunch") return -1 endif endif PROC StartData: if MacroNew%=0 rem Macro5 v2.37 installed if (FgApp%:(Data$))=1 GetFocus: giprint "Opening MailBox file, please wait..." pause 150 endif FgApp%:(Email$) endif PROC MultiBoxProc%:(Type%) LOCAL Button% Start:: if Type%=1 rem call from Main: procedure open IniFile$,a,Email$,EmailRSC$,Data$,DataRSC$,MultiBox%,UserDialog%,DateFormat&,MacroNew% Data$=a.Data$ close dinit AppName$+AppVersion$,16 dtext "","Select the location of your target Data file:" else rem call from IniSetup%: procedure dinit AppName$+" Setup (step 2 of 3) ..." dtext "","Select the location of your default Mailbox Data file:" endif dfile Data$,"File,Folder,Disk",128+8+32,0,0,DataUID& dtext "or choose ...","'New' to create a new Mailbox Data file" if Type%=1 dtext "...","'Word' to store to a Psion Word file" dtext "...","'Setup' to relaunch the Setup procedure" dbuttons "New",%N,"Word",%W,"Setup",%S,"Cancel",27,"Continue",13 else dbuttons "New",%N,"Cancel",27,"Continue",13 endif Button%=dialog if Button%=13 if Data$="" giprint "No target file selected" goto Start:: endif elseif Button%=%s dinit AppName$+AppVersion$ dtext "","Relaunch the Setup procedure?" dtext "","(you will loose the current settings)" dbuttons "Cancel",27,"Continue",13 if dialog delete IniFile$ if IniSetup%: :return -1 :endif else Data$=Right$(SourceBoxName$,4) goto Start:: endif elseif Button%=%n if NewData%:(Type%) :goto Start:: :endif elseif Button%=%w if UseWord%: :goto Start:: :endif else return -1 endif giprint "Target file is "+Data$ pause 20 PROC NewData%:(Type%) LOCAL SetDefault%,SourceBox$(255) SourceBox$=Macros$+SourceBoxName$ if exist (SourceBox$) Data$=Right$(SourceBoxName$,4) dinit AppName$+AppVersion$ dtext "","Create new MailBox Data file:" dfile Data$,"File,Folder,Disk",1+8 if Type%=1 dcheckbox SetDefault%,"Set as default" endif dbuttons "Cancel",27,"Continue",13 if dialog copy SourceBox$,Data$ if SetDefault% and Type%=1 open IniFile$,a,Email$,EmailRSC$,Data$,DataRSC$,MultiBox%,UserDialog%,DateFormat&,MacroNew% a.Data$=Data$ update close endif else return -1 endif else giprint "NEW option not available" Data$=Right$(SourceBoxName$,4) return -1 endif PROC UseWord%: LOCAL Button% Start:: Data$="" dinit AppName$+AppVersion$ dtext "","Select an existing Word file:" dfile Data$,"File,Folder,Disk",128+8+32,0,0,WordUID& dtext "or choose ...","'New' to create a new empty one" dbuttons "New",%N,"Cancel",27,"Continue",13 Button%=dialog if Button%=13 if Data$="" giprint "No target file selected" goto Start:: else UseDoc%:("Word",Data$,3) rem open in background pause 20 PasteToWord%=-1 FgApp%:(Email$) GetFocus: endif elseif Button%=%n Data$="" dinit AppName$+AppVersion$ dtext "","Create a new Word file:" dfile Data$,"File,Folder,Disk",1+8 dbuttons "Cancel",27,"Continue",13 if dialog UseDoc%:("Word",Data$,1) rem create new word file pause 20 PasteToWord%=-1 FgApp%:(Email$) GetFocus: else goto Start:: endif else return -1 endif PROC UserDialogProc%: LOCAL Button% dinit AppName$+AppVersion$ dlong TotMsg&,"Number of messages to store",1,100 dtext "","(starting from the highlighted one and going down)",$200 dcheckbox NoSubj%,"Highlighted message has no subject" dtext "","(this option forces one single message storing)",$200 dcheckbox DelMsg%,"Delete original message from Email" dtext "","(use with care, don't forget to save attachments...)",$200 dbuttons "Cancel",27,"Continue",13 if dialog if NoSubj%=-1 :TotMsg&=1 :endif else return -1 endif if DelMsg% dinit "Please read carefully:" dtext "","You have chosen the ""Auto-Delete"" option, so:" dtext "","- DO NOT touch the keyboard and" dtext "","- DO NOT switch to any other program" dtext "","while the macro is running, as this could also lead to" dtext "","the loss of all your messages...",$200 dtext "","A dialog box will inform you when the task has ended." dbuttons "Disable",%D,"Abort",27,"Continue",13 Button%=dialog if Button%=%d DelMsg%=0 giprint """Auto-Delete"" option disabled" pause 20 elseif Button%<>13 return -1 endif endif PROC CopyFromEmail: LOCAL Dummy$(255) FgApp%:(Email$) SendKey:("Enter") rem open the message pause 50 SendKey:("Fn+Up") rem move to DATE field SendRscMenu:(EmailRSC$,4,&125) rem select all ("Ctrl+a" for UK/USA) Date$=Copy$: if Date$="" rem message is a fax Skip%=-1 TotSkip%=TotSkip%+1 else SendKey:("Right,Down") rem move to FROM field SendRscMenu:(EmailRSC$,4,&125) rem select all Dummy$=Copy$: From$=Left$(Dummy$,250) SendKey:("Right,Down") rem move to TO field SendRscMenu:(EmailRSC$,4,&125) rem select all Dummy$=Copy$: To$=Left$(Dummy$,250) SendKey:("Right,Down") rem move to CC field SendRscMenu:(EmailRSC$,4,&125) rem select all Dummy$=Copy$: CC$=Left$(Dummy$,250) SendKey:("Right,Down") rem move to BCC field SendRscMenu:(EmailRSC$,4,&125) rem select all Dummy$=Copy$: BCC$=Left$(Dummy$,250) SendKey:("Right,Down") rem move to SUBJECT field SendRscMenu:(EmailRSC$,4,&125) rem select all Dummy$=Copy$: Subject$=Left$(Dummy$,250) SendKey:("Right,Fn+Down,Fn+Down") rem move to BODY field SendRscMenu:(EmailRSC$,4,&125) rem select all pause 20 Dummy$=Copy$: Body$=Left$(Dummy$,250) SendKey:("Ctrl+c") rem this copies more than 255 chars endif SendKey:("Esc") rem close message pause 20 PROC AdjustDate: rem the following code simply changes the rem DATE format used in Email (it depends on rem the System settings) to "yyyy/mm/dd hh:mm:ss" rem to have messages properly sorted by date LOCAL D$(4),M$(4),Y$(4) if Skip% :return :endif if DateFormat&=0 rem mm/dd/yyyy D$=Mid$(Date$,3,3) M$=Mid$(Date$,3,1)+Left$(Date$,2) Y$=Mid$(Date$,7,4) Date$=Right$(Date$,Len(Date$)-10) Date$=Y$+M$+D$+Date$ elseif DateFormat&=1 rem dd/mm/yyyy D$=Left$(Date$,2) M$=Mid$(Date$,3,4) Y$=Mid$(Date$,7,4) Date$=Right$(Date$,Len(Date$)-10) Date$=Y$+M$+D$+Date$ endif PROC AdjustFields: rem the following code rearranges the copied fields if Skip% :return :endif if NoSubj% Subject$="< no subject >" elseif Subject$="" or Subject$=Body$ if BCC$="" or BCC$=Body$ Subject$=CC$ :CC$="" :BCC$="" else Subject$=BCC$ :BCC$="" endif endif PROC PasteToData: FgApp%:(Data$) pause 20 if NumMsg%=1 rem first message (or single message) to store SendRscMenu:(DataRSC$,4,&D) rem new entry ("Ctrl+Shift+n" for UK/USA) endif pause 20 if Skip%<>-1 SendKey:("Tab,Tab,Tab,Tab,Tab") rem move to BODY field SendKey:("Ctrl+v") pause 20 SendKey:("Shift+Tab") rem move to CC/BCC field Paste:(CC$+Chr$(013)+BCC$) rem Chr$(013)=carriage return pause 20 SendKey:("Shift+Tab") rem move to TO field if To$<>"" Paste:(To$) endif pause 20 SendKey:("Shift+Tab") rem move to FROM field Paste:(From$) pause 20 SendKey:("Shift+Tab") rem move to DATE field Paste:(Date$) pause 20 SendKey:("Shift+Tab") rem move to TITLE field if Subject$<>"" Paste:(Subject$) endif pause 20 SendRscMenu:(DataRSC$,4,&16) rem save message ("Ctrl+s" for UK/USA) endif if NumMsg%=TotMsg& rem last message (or single message) stored SendKey:("Esc") rem exit from "new entry mode" endif PROC PasteToWord: if Skip% :return :endif FgApp%:(Data$) pause 20 SendRscMenu:(DataRSC$,4,&125) rem select all ("Ctrl+a" for UK/USA) SendKey:("Left,Enter") pause 20 SendKey:("Ctrl+v") SendKey:("Enter") Paste:("************ end of message ************") SendKey:("Enter") SendRscMenu:(DataRSC$,4,&125) rem select all ("Ctrl+a" for UK/USA) SendKey:("Left,Enter") pause 20 if Subject$<>"" SendKey:("Enter") Paste:("* Subject: "+Subject$) pause 20 endif SendKey:("Enter") Paste:("* Date: "+Date$) pause 20 if Subject$<>"" SendKey:("Enter") Paste:("* From: "+From$) pause 20 endif if To$<>"" SendKey:("Enter") Paste:("* To: "+To$) endif pause 20 if CC$<>"" or BCC$<>"" SendKey:("Enter") Paste:("* CC/BCC:"+CC$+Chr$(013)+BCC$) rem Chr$(013)=carriage return endif SendKey:("Enter") Paste:("* Body:") pause 20 SendRscMenu:(DataRSC$,4,&125) rem select all ("Ctrl+a" for UK/USA) pause 10 SendKey:("Left") PROC Report: GetFocus: if Len(To$)=250 or Len(CC$)=250 or Len(BCC$)=250 dinit AppName$+" warning" dtext "","Check if the last saved message contains one of" dtext "","the To/CC/BCC fields exceeding the 250 chars limit" if TotMsg&>1 NumMsg%=TotMsg& dtext "","The message storing procedure has been stopped..." endif if DelMsg% dtext "","The original message won't be deleted from Email" endif dbuttons "Continue",13 dialog SendKey:("Esc") rem exit from "new entry mode" (if necessary) else if Skip% giprint "Message NOT stored" elseif TotMsg&>1 rem storing a group of messages giprint "Message "+gen$(NumMsg%,3)+" of "+gen$(TotMsg&,3)+" stored" else giprint "New message stored" endif pause 20 FgApp%:(Email$) pause 20 if DelMsg% and Skip%<>-1 Sendkey:("Del") rem delete current message SendRscButton:("z:\System\Data\Eikon.rsc",308,2) rem confirm deletion with "Yes" button pause 20 else SendKey:("Down") rem move down to the next message endif if NumMsg%=TotMsg& and (TotMsg&>1 or DelMsg% or Skip%) rem last message of a group GetFocus: dinit AppName$+AppVersion$ if TotSkip%>0 dtext "","Unable to store "+gen$(TotSkip%,3)+" message(s)",$200 endif dtext "",gen$(TotMsg&-TotSkip%,3)+" message(s) successfully stored to:" dtext "",Data$ dbuttons "Continue",13 dialog endif endif NumMsg%=NumMsg%+1 Skip%=0 *TextEd.app "Data.app)@ Table1 Subject CC/BCC Arial Arial Arial Table1 ColA9 ColB9 ColA11 ColB11 ColA12 ColB12 ColA13 ColB13 ColA14 ColB14 ColA16 ColB16 Index1 ColA11 ColA9 Table1 Subject CC/BCC Arial Arial Arial Times New Roman &Heading 1L &Heading 2L &Heading 3L .Bullet listO Swiss Welcome to SAVEMAIL Macro v2.51 for Epoc Release 3 ------------------ To be used with Macro5 (from v2.37) and a Psion S5 or Geofox + MsgSuite Email (v1.52) WHAT'S NEW ------------------ v 2.51 * improved the handling of messages stored to a Psion Word file: the wbox extension has been eliminated, so any Word file can be selected as a target file; now the cursor is always left at the beginning of the file when the storing procedure ends; if you select an existing Word file, now the macro opens it in background (faster) * changed the structure of SaveMail.ini file: the first time the macro is run, a dialog box will ask to relaunch the Setup procedure and upgrade the .ini file PLEASE READ CAREFULLY ------------------ SaveMail is a macro that automates the process of copying your messages from Psion MsgSuite Email to any number of "preformatted" Psion Data files (e.g. one for Work and another for Home), or to a "plain" Psion Word documents, where they can be easily edited, sorted, printed, searched or simply stored. Before proceeding, keep in mind the following: * especially when you choose to store multiple messages, SaveMail may take some time to accomplish its task: please note that while the macro is running, Macro5 is NOT available for other operations and you also should NOT switch to other tasks or applications; * be also advised NOT to touch the keyboard while SaveMail is running, because you could interfere with the scheduled sequence of keystrokes, thus leading to some misbehavior of the macro itself (including the deletion of all your messages in the worst case, only if the "auto-delete" option is selected); * if a message contains one or more ATTACHMENTS, the macro simply ignores them, so be careful to manually save them before deleting the original message from MsgSuite; * use the "auto-delete" option with care, as there is no way of restoring any deleted message from Psion Email. I strongly recommend a good BACKUP before starting to play with SaveMail... * I decline responsibility for any loss of data that may result from the use of this program. HOW TO INSTALL AND USE ------------------ 1) Unzip the savem_r3.zip file. 2) Copy SaveMail.opo, SaveMail.ico and SaveMail.box to the folder where you keep all the macros of Macro5. The SaveMail.box file is the "preformatted" Data file used to create new MailBox Data files from within the macro. DO NOT use this file to store your messages, just leave it empty in your macros folder. 3) Launch Macro5 and create a new shortcut to SaveMail.opo (remember to select "Macro" and not "Program" in the shortcut "Type" definition). 4) Call SaveMail macro through the associated Macro5 shortcut: the first time you launch it, a Setup process will start, showing your System settings: location of your Email program, Date format and Macro5 version (remember you need v2.37 at least, as this macro is not tested with previous releases; also note that if you upgrade from v2.37 to 2.40 or later in a second time, you will have to relaunch this setup): simply check if these settings are correct; once passed the first window, a second one will ask you for the location of your default Data file (the one that will be used by default to store your messages); if you do not have previous .box Data files to use, select NEW and a dialog will let you create a new Data file and place it wherever you want (the .box extension will be automatically added if you forget it); finally a last window will ask if you want to enable the choice of different Data files (note that you can create multiple Data files also in a second time using the NEW option), and if you want to open a dialog window to automate the process of storing (and deleting) a group of messages each time you launch SaveMail. 5) All these settings are stored in a SaveMail.ini file located in the "C:\System\" folder; if for any reason you need to change these settings (e.g. you changed the date format in the System settings, or upgraded Macro5 from v2.37 to v2.40), simply delete the file, and when you will recall SaveMail, the setup process will be launched again. Alternatively, you can relaunch the Setup procedure from within the macro, in the target data file window (if enabled). 6) Once accomplished the setup process, these are the steps to follow: - launch your Email program - select the Inbox or the Sent folder - highlight a message without opening it (do not press Enter) - call SaveMail macro through the associated Macro5 shortcut 7) According to the options you have selected in the setup process, once launched, SaveMail may: - ask for the location of your target Data file to store your message(s) - ask for the number of messages to automatically store - ask if it has to delete the original message(s) from Email - ask if the highlighted message has no subject (see known issues) 8) If everything is OK, once SaveMail has finished its task, you should find yourself again in the Email screen, but you should also find the message(s) stored in the (selected) target Data file. UPGRADING ------------------ * If you have v2.10 or later, simply replace SaveMail.opo and SaveMail.box with the new ones (all your settings won't be lost). * If you already have a MailBox Data file from v2.00, simply rename it, in order to add the ".box" extension. * If you need to upgrade from v1.xx just follow the instructions in the history.txt file. NOTES ON THE "PREFORMATTED" MAILBOX DATA FILES ------------------ The "preformatted" DATA files, where the messages from Email are stored, have the following labels: Subject (type: text length: 250) second sorting key (ascending) Date (type: text length: 30) first sorting key (descending) From (type: text length: 250) To (type: text length: 250) CC/BCC (type: memo length: unlimited) Body (type: memo length: unlimited) NOTES ON THE "PLAIN" WORD FILE ------------------ You can save your message(s) to a "plain" Psion Word file; the macro can create a new Word target file for you, or can use an existing one; each field of the original message(s) is copied as text, with an appropriate description (e.g. subject, date etc.); if the target file already contains other text, the new message will not overwrite it, but will be placed at the beginning of the document. NOTES ON THE DATE FORMAT OF THE MESSAGES ------------------ This macro copies the DATE string of the original message (no matter which format is selected in your System settings) and changes it to "yyyy/mm/dd hh:mm:ss" in order to have them correctly sorted by date in the MailBox file (it works both with 12h and 24h TIME format). TRANSLATING THE OPL CODE ------------------ Feel free to modify the source code (SaveMail.opl) as you like... If the translation fails with a "not found" message and the cursor at the line INCLUDE "Systinfo.oxh", it means that you have to install that file to your "System\OPL\" folder; feel free to email me at the address below and I will send you a copy. KNOWN ISSUES ------------------ * If a message has the TO, CC or BCC fields particularly long (e.g. sent to a list of people) only the first 250 characters will be copied to the Data file; if this happens, a dialog is displayed to alert you * The macro can't deal with FAXES: such messages are simply ignored and never deleted (even if you selected the "auto-delete" option); a final report window will let you know the number of messages not stored * If a message has NO SUBJECT, you have to tell this to SaveMail, using the apposite DIALOG WINDOW (if enabled), otherwise the macro will put the content of the first field it finds above the empty subject into the subject of the MailBox file and you have to manually rearrange the fields once the macro has ended its task... ACKNOWLEDGMENTS ------------------ A great thank you to: * Pascal Nicolas for writing Macro5 and helping me in making this macro work... Visit his homepage for a huge library of useful macros: http://pnicolas.epocboulevard.com/ * Mario Collado (author of Assistant) for all his suggestions! Visit his homepage at http://www.psionwelt.net/MarioCollado/ Any comments & suggestions are welcome! E-mail me at: sergioalisi@geocities.com Visit my homepage at: http://www.geocities.com/siliconvalley/bridge/1492 THANKS & ENJOY Courier Courier "word.app Times New Roman &Heading 1L &Heading 2L &Heading 3L .Bullet listO Swiss ApSAVEMAIL HISTORY & UPGRADING INSTRUCTIONS ------------------ v 1.00 * first public release v 1.10 * "internationalized" version, should work with any language of the Psion S5 and MsgSuite 1.52 v 1.11 * fixed a bug when the date format was 12 hours am/pm v 1.12 * fixed a bug that caused the date string to be copied into the title when the subject was particularly long v 1.13 * fixed a bug that sometimes prevented the "from" field from being copied; no more "display switching" between Email and the Data file during the copy & paste procedures (saves time and batteries...) v 1.20 * all the message fields are now copied in one single step, then pasted all together to the Data file (saves time); * rewritten the date format procedure (now much faster); * to prevent a "compressing file to save memory" routine from interfering with the correct timing of the macro, the Data file is now always opened at the beginning of SaveMail v 1.21 * CC and BCC fields, if present in the original MsgSuite message, are simply ignored and no more pasted to the wrong place (the title field) of the MailBox Data file v 2.00 * CC and BCC fields, if present, are now correctly stored to a new field (CC/BCC) in the Mailbox Data file; see UPGRADING below * fixed a bug that made the macro crash when trying to copy a field (other than body) with more than 250 characters; see KNOWN ISSUES v 2.10 * no more headaches while struggling with the opl code to adapt it to your folders, CF cards etc. and re-translating the whole! Now the macro is supplied in a ready-to-go SaveMail.opo file and a complete setup process will guide you the first time you launch SaveMail; * added the option of using multiple Data files to store different kinds of messages (see UPGRADING below); * added the option of automatically archiving a group of messages and deleting them from Email, if necessary; * now SaveMail detects your DATE FORMAT from the System settings and works correctly according to them (no more problems for the American MM/DD/YYYY format!). v 2.11 * added the option to create a NEW Data file from within the macro; * the SaveMail.ini file (which contains your setup details) is now stored to the "C:\System\" folder to prevent a "Syntax error" if any "illegal" character (e.g. space) is contained in the path of the macros folder (if you want to keep the .ini file saved with v2.10, simply move it from your macros folder to the new location, otherwise delete it); * now fully compatible with Geofox machines (no need to modify the code and retranslate, just use the supplied SaveMail.opo file); * added a report window after a successful archiving of more messages; * now SaveMail, if run as a standalone app, doesn't crash but informs the user that it has to be launched through Macro5. v 2.12 * due to an oversight on my side, all the "preformatted" Data files shipped with the previous releases of SaveMail had the FIND facility disabled; the new SaveMail.box of this release fixes the problem, but if you have previous Data files, simply open them, choose Menu/Tools/Find by label... and tick all the labels you want to include in your search (the more labels you select, the slower will be the search, especially with big Data files); * added a progress report after each message of a group is successfully stored (e.g. "Message 2 of 8 stored"); * minor changes to some dialog windows. v 2.20 * fixed a bug that made the macro crash when archiving messages with an empty "TO" field (e.g. the Psion.life mailing list from Psion) * now the SaveMail Setup may be relaunched from within the macro, in the target data file window (if enabled). v 2.30 * easier setup: now SaveMail automatically detects the version of Macro5 you have installed on your machine; * rewritten the procedure to test if SaveMail is launched as a macro; * added a warning window when the "auto-delete" option is selected; * now works on the 5mx, with some limitations; v 2.40 * added the option of storing the messages to a "plain" Word file; * added an icon (SaveMail.ico) for the graphic panels of Macro5 v2.40; * in the setup procedure, added the option of changing the "Yes button keystroke" of the Email app if SaveMail fails to detect the right one (may happen if the language of your S5 differs from the one of Email) v 2.41 * for 5mx users only: solved a problem due to the Email program which deletes the From field from any stored "Sent" message (moved from the "Sent" folder to any other user-defined folder) * should work with any language of the 5mx and 5mx-pro (feedback is welcome, as I can only work on the Epoc R5 PC Emulator...) v 2.42 * for 5mx users only: now the macro lets you specify a Date and Time which will be put in the Time field of any stored message * for 5mx users only: the "auto-delete" option has been re-enabled, as the above option allows you a better handling of each message v 2.50 * from this version onwards there are two different macros for Epoc Release 3 (Psion S5 and Geofox) and Release 5 (Psion S5mx etc.) * no more crashes when the macro finds a FAX: now such messages are simply ignored (SaveMail can't deal with them) and never deleted * found a better way to get the "Yes button keystroke": no more need to ask for it in the Setup procedure v 2.51 * improved the handling of messages stored to a Psion Word file: the wbox extension has been eliminated, so any Word file can be selected as a target file; now the cursor is always left at the beginning of the file when the storing procedure ends; if you select an existing Word file, now the macro opens it in background (faster) UPGRADING from v2.00 to v2.10 ------------------ If you already have a MailBox Data file from v2.00, simply RENAME it in order to add the ".box" EXTENSION (e.g. in system screen highlight the MailBox file, select Menu/File/Rename and change the name to Mail.box) UPGRADING from v1.xx to v2.00 ------------------ The new Mail.box Data file you find in the savemail.zip file has been modified to make place for the CC/BCC field; if you already have a MailBox Data file from previous versions of SaveMail, you have to modify it in order to create this new field: * open your old MailBox Data file * select Menu/Tools/Change labels... * select ADD... * in the "label" field write: CC/BCC * in the "data type" select: MEMO * choose OK two times * select Menu/Tools/Label preferences... * with the down arrow highlight CC/BCC * choose the "Move Up" button * now you should have the CC/BCC label positioned between TO and Body * choose OK * now your Data file is upgraded to SaveMail v2.xx Courier Courier "word.app This SIS-file is designed by BISON Software. Bison Software doesn't accept any liability for the function of the programme to be installed. Please pay attention to the comment in the README file of the author. Before installing this software please make a B A C K U P of your Psion. Have a lot of fun! Diese SIS-Datei wurde von Bison Software erstellt. Bison Software bernimmt keinerlei Garantie f r die Funktion des zu installierenden Programmes. Bitte beachten Sie die Hinweise in der README Datei des Autors. Bevor Sie das Programm installieren machen Sie ein B A C K U P Ihres Psion. Viel Spa