C:\Sistemp\SaveNews.opo!:\Psion5CD1\SaveNewsforMacro5\SaveNews.opoC:\Sistemp\SaveNews.opl!:\Psion5CD1\SaveNewsforMacro5\SaveNews.oplC:\Sistemp\SaveNews.ico!:\Psion5CD1\SaveNewsforMacro5\SaveNews.icoC:\Sistemp\SaveNews.box!:\Psion5CD1\SaveNewsforMacro5\SaveNews.boxC:\Sistemp\readme!:\Psion5CD1\SaveNewsforMacro5\readmeC:\Sistemp\Bis.txt!:\Psion5CD1\SaveNewsforMacro5\Bis.txtSaveNewsforMacro5 26.8 kB7 )C:\Documents\OPL\Wk SaveNews\SaveNews.oplV NEWS$ DATA$ NEWSRSC$ DATARSC$ MULTIBOX% USERDIALOG% MACRONEW% NUMMSG& NUMMSG% DELMSG% DATE$ FROM$ SUBJECT$ BODY$ MACRO5TEST MACRO5VER INISETUP% STARTNEWS% GETFOCUS MULTIBOXPROC% USERDIALOGPROC% STARTDATA COPYFROMNEWS% ADJUSTDATE PASTETODATA REPORT GETAPP$ NEWS$ SaveNews+ MacroK+ v1.00K+%To be launched as a macro with Macro5W8 LIBVERSION% MACRONEW% LIBVERSION% MULTIBOXPROC% NEWS$ NEWSRSC$ DATA$ DATARSC$ MACRONEW% MULTIBOX% USERDIALOG% SaveNews+ MacroK+ v1.00K+ Sorry, I can't find RMRNews.appW8 C:\System\SaveNews.iniW SaveNews.boxO Z:\System\Apps\Data\Data.rsc Z:\System\Apps\Data\Data.ruk SaveNews+ MacroK+ v1.00K+ Sorry, I can't find Data.rsc/rukW8 SaveNews+ Setup (step 1 of 3) ...K +(- your RMRNews.app is located on drive " - your Macro5 version is S OdT|O +;- SaveNews is not tested with Macro5 versions prior to 2.37 CancelO ContinueO SaveNews+ Setup aborted...K+ Relaunch the macro to completeW8 SaveNews+ Setup aborted...K+ Relaunch the macro to completeW8 SaveNews+ Setup (step 3 of 3)K +)Each time you launch SaveNews you can ... +'- have a choice of the target Data file +.- open a dialog window to automate the process +)of archiving/deleting a group of articles CancelO ContinueO SaveNews+ Setup aborted...K+ Relaunch the macro to completeW8 C:\System\SaveNews.ini DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATA$' DATARSC$' + MULTIBOX%$ USERDIALOG%$ SaveNews+ Setup successfully completed...K+ Now you can relaunch the macroW8 C:\System\SaveNews.ini DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATA$# DATARSC$# + MULTIBOX% USERDIALOG% FGAPP% GETFOCUS MACRONEW% NEWS$ + Opening RMRNews, please wait ...O ++SaveNews has opened your RMRNews program...+,Now highlight an article header and relaunchW8 Opening RMRNews, please wait... +&SaveNews is opening RMRNews program...+(Highlight an article header and relaunchW8 FGAPP% GETFOCUS MACRONEW% DATA$ NEWS$ +$Opening NewsBox file, please wait... INISETUP% MACROS$ DATA$ SaveNews.boxK SaveNews+ v1.00K +-Select the location of your target Data file: SaveNews+ Setup (step 2 of 3) ...K +6Select the location of your default NewsBox Data file: File,Folder,Disk( HO HO +3... or choose New to create a new NewsBox Data file NewON+ Relaunch SetupOS+ CancelO ContinueO NewON+ CancelO ContinueO SaveNews.boxO No taget file selected SaveNews+ v1.00K Relaunch the Setup procedure? +%(you will loose the current settings) CancelO ContinueO C:\System\SaveNews.ini On@[d SaveNews.boxO SaveNews+ v1.00K Create new NewsBox Data file: File,Folder,DiskO Set as default CancelO ContinueO C:\System\SaveNews.ini DATA$ DATARSC$ MULTIBOX% USERDIALOG% DATA$' SaveNews.boxO NEW option not available Target file is NUMMSG& DELMSG% SaveNews+ v1.00K Number of articles to archiveO +2(starting from the highlighted one and going down)( +$Delete original article from RMRNews +1(use with care, no undelete options available...)( 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 articles...( +5A dialog box will inform you when the task has ended. DisableOD+ AbortO ContinueO Od@[0 "Auto-Delete" option disabled FGAPP% SENDKEY COPY$ GETFOCUS NEWS$ NUMMSG% DATA$ FROM$ SUBJECT$ BODY$ EnterO Ctrl+aO Fn+Up,Fn+UpO Ctrl+aO DownO Ctrl+aO DownO Ctrl+cO DATE$ (*)K FGAPP% SENDRSCMENU SENDKEY PASTE DATA$ NUMMSG% DATARSC$ FROM$ DATE$ SUBJECT$ NUMMSG& Tab,Tab,Tab,Tab,TabO Ctrl+vO + Shift+TabO + Shift+TabO + Shift+TabO + Shift+TabO + Shift+TabO GETFOCUS SENDKEY FGAPP% FROM$ SUBJECT$ NUMMSG& NUMMSG% DELMSG% NEWS$ DATA$ SaveNews+ warningK +3Check if the last saved article contains one of the +4From or Subject fields exceeding the 250 chars limit ++The archiving procedure has been stopped... +2The original article won't be deleted from RMRNews ContinueO Article of K 1 storedK New article stored DownO SaveNews+ v1.00K +# article(s) successfully stored to:K ContinueO MAIN> MACRO5TEST MACRO5VER INISETUP% STARTNEWS% STARTDATAL MULTIBOXPROC% USERDIALOGPROC%0 COPYFROMNEWS% ADJUSTDATE PASTETODATA REPORT REM Macro SaveNews v1.00 REM To be used with Macro5 (from v2.37) REM and RMRNews News Reader for EPOC (v1.00F English) REM by S.Alisi - sergioalisi@geocities.com REM http://www.geocities.com/siliconvalley/bridge/1492 CONST AppName$="SaveNews" CONST AppVersion$=" v1.00" CONST DataUID&=&10000086 CONST NewsUID&=&100004A1 CONST IniFile$="C:\System\SaveNews.ini" CONST SourceBoxName$="SaveNews.box" CONST YesBtn$="Y" rem "Yes button" shortcut in RMRNews PROC Main: GLOBAL News$(255),Data$(255) GLOBAL NewsRSC$(255),DataRSC$(255) GLOBAL MultiBox%,UserDialog%,MacroNew% GLOBAL NumMsg&,NumMsg%,DelMsg% GLOBAL Date$(30),From$(250),Subject$(250),Body$(250) Macro5Test: Macro5Ver: NumMsg&=1 :NumMsg%=1 if IniSetup%: :return :endif if StartNews%: :return :endif GetFocus: if MultiBox% if MultiBoxProc%:(1) :return :endif endif if UserDialog% if UserDialogProc%: :return :endif endif StartData: while NumMsg%<=NumMsg& if CopyFromNews%: :return :endif AdjustDate: PasteToData: Report: NumMsg%=NumMsg%+1 endwh PROC Macro5Test: rem check if SaveNews is launched from Macro5 and as a macro onerr No_Macro:: News$=GetApp$:(NewsUID&) rem for S5 & Geofox goto Yes_Macro:: No_Macro:: onerr off alert(AppName$+" Macro"+AppVersion$,"To be launched as a macro with Macro5") stop Yes_Macro:: PROC Macro5Ver: rem check which version of Macro5 is currently installed onerr Old_Macro:: if LibVersion%: >=240 MacroNew%=-1 endif goto Done:: Old_Macro:: onerr off MacroNew%=0 stop Done:: PROC IniSetup%: if News$="" alert(AppName$+" Macro"+AppVersion$,"Sorry, I can't find RMRNews.app") return -1 endif NewsRSC$=Left$(News$,Len(News$)-3)+"rsc" if not exist (IniFile$) 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$+" Macro"+AppVersion$,"Sorry, I can't find Data.rsc/ruk") return -1 endif endif dinit AppName$+" Setup (step 1 of 3) ..." dtext "","- your RMRNews.app is located on drive """+Left$(News$,1)+"""" if MacroNew% dtext "","- your Macro5 version is "+gen$(LibVersion%:/100,2)+"."+right$(gen$(LibVersion%:,4),2) else dtext "","- SaveNews is not tested with Macro5 versions prior to 2.37" endif dbuttons "Cancel",27,"Continue",13 if dialog else alert(AppName$+" Setup aborted...","Relaunch the macro to complete") return -1 endif if MultiBoxProc%:(0) alert(AppName$+" Setup aborted...","Relaunch the macro to complete") return -1 endif dinit AppName$+" Setup (step 3 of 3)" dtext "","Each time you launch SaveNews you can ..." dcheckbox MultiBox%,"- have a choice of the target Data file" dtext "","- open a dialog window to automate the process" dcheckbox UserDialog%,"of archiving/deleting a group of articles" dbuttons "Cancel",27,"Continue",13 if dialog else alert(AppName$+" Setup aborted...","Relaunch the macro to complete") return -1 endif create IniFile$,a,Data$,DataRSC$,MultiBox%,UserDialog% a.Data$=Data$ a.DataRSC$=DataRSC$ a.MultiBox%=MultiBox% a.UserDialog%=UserDialog% append close alert(AppName$+" Setup successfully completed...","Now you can relaunch the macro") return -1 else open IniFile$,a,Data$,DataRSC$,MultiBox%,UserDialog% Data$=a.Data$ DataRSC$=a.DataRSC$ MultiBox%=a.MultiBox% UserDialog%=a.UserDialog% close endif PROC StartNews%: if MacroNew% rem Macro5 v2.40 or later installed busy "Opening RMRNews, please wait ...",3,1 if (FgApp%:(News$))=1 busy off GetFocus: alert("SaveNews has opened your RMRNews program...","Now highlight an article header and relaunch") return -1 endif busy off else rem Macro5 v2.37 installed if (FgApp%:(News$))=1 GetFocus: giprint "Opening RMRNews, please wait..." pause 90 alert("SaveNews is opening RMRNews program...","Highlight an article header and relaunch") return -1 endif endif PROC StartData: if MacroNew%=0 rem Macro5 v2.37 installed if (FgApp%:(Data$))=1 GetFocus: giprint "Opening NewsBox file, please wait..." pause 150 endif FgApp%:(News$) endif PROC MultiBoxProc%:(Type%) LOCAL Button%,SetDefault%,SourceBox$(255) Startup:: SourceBox$=Macros$+SourceBoxName$ if Type%=1 rem call from Main: procedure dinit AppName$+AppVersion$ 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 NewsBox Data file:" endif dfile Data$,"File,Folder,Disk",128+8+32,0,0,DataUID& dtext "","... or choose New to create a new NewsBox Data file" if Type%=1 dbuttons "New",%N,"Relaunch Setup",%S,"Cancel",27,"Continue",13 else dbuttons "New",%N,"Cancel",27,"Continue",13 endif Button%=dialog if Button%=13 if Data$="" Data$="*"+Right$(SourceBoxName$,4) giprint "No taget file selected" goto Startup:: 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 goto Startup:: endif elseif Button%=%n if exist (SourceBox$) Data$=Right$(SourceBoxName$,4) dinit AppName$+AppVersion$ dtext "","Create new NewsBox 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,Data$,DataRSC$,MultiBox%,UserDialog% a.Data$=Data$ update close endif else goto Startup:: endif else Data$="*"+Right$(SourceBoxName$,4) giprint "NEW option not available" goto Startup:: endif else return -1 endif giprint "Target file is "+Data$ pause 20 PROC UserDialogProc%: LOCAL Button% dinit AppName$+AppVersion$ dlong NumMsg&,"Number of articles to archive",1,100 dtext "","(starting from the highlighted one and going down)",$200 dcheckbox DelMsg%,"Delete original article from RMRNews" dtext "","(use with care, no undelete options available...)",$200 dbuttons "Cancel",27,"Continue",13 if dialog 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 articles...",$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 CopyFromNews%: LOCAL Dummy$(255) FgApp%:(News$) SendKey:("Enter") rem open the article pause 10 SendKey:("Ctrl+a") rem select all (from BODY field) Dummy$=Copy$: if Len(Dummy$)=0 rem article not available off-line beep: GetFocus: giprint "Stop" pause 20 if NumMsg%>1 rem other articles already stored FgApp%:(Data$) pause 10 SendKey:("Esc") rem exit from "new entry mode" FgApp%:(News$) endif return -1 else SendKey:("Fn+Up,Fn+Up") rem move to NewsGroups field SendKey:("Ctrl+a") rem select all Dummy$=Copy$: From$=Left$(Dummy$,250) SendKey:("Down") rem move to SUBJECT field SendKey:("Ctrl+a") rem select all Dummy$=Copy$: Subject$=Left$(Dummy$,250) SendKey:("Down") rem move to BODY field pause 20 Dummy$=Copy$: Body$=Left$(Dummy$,250) SendKey:("Ctrl+c") rem this copies more than 255 chars SendKey:("Esc") rem close article pause 20 endif PROC AdjustDate: rem the following code simply puts the time of archiving rem to the date field of the target data file Date$=gen$(year,4)+"/"+right$("0"+gen$(month,2),2)+"/"+right$("0"+gen$(day,2),2) Date$=Date$+" "+right$("0"+gen$(hour,2),2)+":"+right$("0"+gen$(minute,2),2)+" (*)" PROC PasteToData: FgApp%:(Data$) pause 20 if NumMsg%=1 rem first article (or single article) to store SendRscMenu:(DataRSC$,4,&D) rem new entry ("Ctrl+Shift+n" for UK/USA) endif pause 20 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 SendKey:("Shift+Tab") rem move to TO field 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 article ("Ctrl+s" for UK/USA) if NumMsg%=NumMsg& rem last article (or single article) stored SendKey:("Esc") rem exit from "new entry mode" endif PROC Report: GetFocus: if Len(From$)=250 or Len(Subject$)=250 dinit AppName$+" warning" dtext "","Check if the last saved article contains one of the" dtext "","From or Subject fields exceeding the 250 chars limit" if NumMsg&>1 NumMsg%=NumMsg& dtext "","The archiving procedure has been stopped..." endif if DelMsg% dtext "","The original article won't be deleted from RMRNews" endif dbuttons "Continue",13 dialog SendKey:("Esc") rem exit from "new entry mode" (if necessary) else if NumMsg&>1 rem storing a group of articles giprint "Article "+gen$(NumMsg%,3)+" of "+gen$(NumMsg&,3)+" stored" else giprint "New article stored" endif pause 20 FgApp%:(News$) pause 20 if DelMsg% Sendkey:("Del") rem delete current article Sendkey:(YesBtn$) rem confirm deletion with "Yes" button pause 20 else SendKey:("Down") rem move down to the next article endif if NumMsg%=NumMsg& and (NumMsg&>1 or DelMsg%) rem last article of a group GetFocus: dinit AppName$+AppVersion$ dtext "",gen$(NumMsg&,3)+" article(s) successfully stored to:" dtext "",Data$ dbuttons "Continue",13 dialog endif endif *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 cWelcome to SAVENEWS Macro v1.00 ------------------ To be used with Macro5 (from v2.37) and RMRNews News Reader for EPOC (v1.00F English) PLEASE READ CAREFULLY ------------------ SaveNews is a macro that automates the process of storing your articles from RMRNews to any number of "preformatted" Data files (e.g. one for each NewsGroup you have subscribed). Before proceeding, keep in mind the following: * especially when you choose to archive multiple articles, SaveNews 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 SaveNews 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 articles in the worst case, only if the "auto-delete" option is selected); * use the "auto-dele" option with care, as there is no way of restoring any deleted article from RMRNews. I strongly recommend a good BACKUP before starting to play with SaveNews... * I decline any responsibility for any loss of data that may result from the use of this program. HOW TO INSTALL AND USE ------------------ 1) Unzip the savenews.zip file. 2) Copy SaveNews.opo, SaveNews.ico and SaveNews.box to the folder where you keep all the macros of Macro5. The SaveNews.box file is a "preformatted" Data file used to create new target Data files from within the macro. DO NOT use this file to store your articles, just leave it empty in your macros folder. 3) Launch Macro5 and create a new shortcut to SaveNews.opo (remember to select "Macro" and not "Program" in the shortcut "Type" definition). 4) Call SaveNews macro through the associated Macro5 shortcut: the first time you launch it, a Setup process will start, showing your System settings: location of your RMRNews program, and Macro5 version (remember you need v2.37 at least, as this macro is not tested with previous releases); a second dialog will ask you for the location of your default Data file (the one that will be used by default to store your articles); 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 archiving (and deleting) a group of articles each time you launch SaveNews. 5) All these settings are stored to a SaveNews.ini file located in the "C:\System\" folder; if for any reason you need to change these settings, simply delete the file, and when you will recall SaveNews, 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 RMRNews program - highlight an article without opening it (do not press Enter) - call SaveNews macro through the associated Macro5 shortcut NOTE: if the highlighted article is not available off-line (you just downloaded the header), the macro automatically stops and the connection window will be displayed, so that you can retrieve the whole article from your news server, or abort the connection. 7) According to the options you have selected in the setup process, once launched, SaveNews may: - ask for the location of your target Data file to store your article(s) - ask for the number of articles to automatically archive - ask if it has to delete the original article(s) from RMRNews 8) If everything is OK, once SaveNews has finished its task, you should find yourself again in the RMRNews screen, but you should also find the article(s) stored in the (selected) target Data file. NOTES ON THE NEWSBOX DATA FILE ------------------ The "preformatted" DATA file, where the articles from RMRNews are stored, has 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) The format of the Date field is "yyyy/mm/dd" in order to have the articles correctly sorted by time in the NewsBox file. Some of the above fields are not used by SaveNews, but are left to maintain the full compatibility with the Data files used by SaveMail (a similar macro that works with the Email application), so you can also use "mixed" target files to store articles or messages both from RMRNews and the Email application. TRANSLATING THE OPL CODE ------------------ Feel free to modify the source code (SaveNews.opl) as you like... KNOWN ISSUES ------------------ * If an article has a field (excluded the body of the article) with more than 250 characters, only the first 250 will be copied to the Data file; if this happens, a dialog is displayed to alert you * the Date field of the target Data file will show the time of archiving, marked with (*) and not the real time of the message; if you want to store the real time of the message, then open RMRNews (Article view) and select menu - view - "show headers": some additional information (including date & time of the article) will be copied to the body field of the target Data file ACKNOWLEDGMENTS ------------------ A great thank you to: * Pascal Nicolas for writing Macro5 Visit his homepage for a huge library of useful macros: http://www.geocities.com/SiliconValley/Pines/1215/ * Serge Chestopalov for writing RMRNews, available from RMR Software at: http://www.rmrsoft.com/ * Roger R. Prokic for suggesting and beta testing this macro 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 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