home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 12 / Doc.txt next >
Encoding:
Text File  |  1999-09-21  |  35.4 KB  |  679 lines

  1.                  Macro5 v2.40
  2.                  ------------
  3.  
  4. Macro5 is a small but efficient program designed
  5. to enable you to make more effective use of your PDA.
  6. It allows you to define up to 16 hotkeys and 3 panels
  7. of 27 shortcuts for :
  8.  
  9.    1) Switching directly to applications or documents
  10.    (run them if not started). When you need an info, you don't
  11.    have to bother anymore whether the application is already
  12.    running or not (then having to switch to the shell in order
  13.    to find and start it) : you just key the corresponding
  14.    shortcut and youÆre in.
  15.  
  16.    2) Pasting predefined texts (with keywords like %%date%%,
  17.    %%time%%, %%query question_text%%).
  18.  
  19.    3) Executing macros (all the OPL, some new commands, send
  20.    keys, etc...) for shortcuting all your repetitive tasks
  21.    (e.g. direct access to the battery statistics, automatic link
  22.    between your agenda and your data files, help on a selected
  23.    command in the OPL editor, immediate link on/off, inserting
  24.    new tasks in your agenda, modifying text, restart of your
  25.    programs after a backup with PsiWin, ..., and all the
  26.    small utilities that are not complex enough to make an app
  27.    but you use all the time).
  28.  
  29.    4) Switching directly to folders.
  30.  
  31.    5) Remapping keys.
  32.  
  33. Since hotkeys can be any of the silkscreen keys, you can re-assign
  34. the sensitive keys to run your favorite applications and macros.
  35.  
  36. For those, like me, who hate to press Ctrl+Shift+Key in order
  37. to access certain Menu functions, (always miss a key and got
  38. the wrong menu or a new character in the document), Macro5
  39. provides a hotkey that will prompt for a key and send
  40. Ctrl+Shift+Key to the current application.
  41.  
  42. And last but not least, it  enables you to cycle through
  43. tasks (like ctrl-tab on Windows), to display a tasklist,
  44. to run macros at startup & switch on and to manage your
  45. display at switch on (backlight and contrast).
  46.  
  47.  
  48. Usage :
  49. -------
  50.  
  51. 1) You display a TaskList by pressing the TaskList Hotkey (Fn+Del by default).
  52.    You may then switch to the selected task or close it.
  53.  
  54. 2) To cycle through the tasks, hold down Ctrl, browse the applications with
  55.    the Space Bar and release Ctrl when you have found the one your are looking
  56.    for. It works like Ctrl-Tab on Windows. Esc or Del cancels the cycling (notice
  57.    that the  hotkey is defined as Fn+Key, then Fn+Esc will switch off your machine).
  58.    Any other key will cycle backward. Since you do not switch to Macro5 itself
  59.    very often, it does not appear in the cycle. Use the tasklist to access it.
  60.  
  61. 3) You run a shortcut by typing first the Shortcuts Panel Hotkey (Fn+N by default),
  62.    and then the key of the shortcut (26 letters and Space). If you configured Macro5
  63.    for not displaying the shortcuts panels, any non-letter key or any non-assigned
  64.    letter will pop it up.
  65.    You move from one panel to the others with 'Tab', the arrow keys or the panel hotkeys.
  66.    'Esc' or the hotkey of the panel will cancel the action. 'Menu' will switch back to
  67.    Macro5.
  68.    You can organize the shortcuts in the panels according to their use (e.g. App, Doc,
  69.    Macro or Office, Home, Miscellaneous). You can assign silkscreen keys to panel hotkeys
  70.    and thereby call and run shortcuts with the pen only.
  71.    You can set the most used shortcuts to hotkeys and run them with a single keystroke.
  72.    When in the graphic mode, all the icons may be customized by creating multi-bitmap
  73.    files labeled xxx.ico where xxx is the name of the file for the types 'Document',
  74.    'Program' and 'Macro' or the name of the caption for the types 'ClipText', 'Folder'
  75.    and 'KeyStroke'. They must be put along the opo/app files for the types 'Macro'
  76.    and 'Program' or in \Macros\Icons for all the other types. These files must contain
  77.    first the bitmap of the icon and then the bitmap of the mask.
  78.  
  79. 4) You send Ctrl+Shift+Key by pressing the Ctrl+Shift Hotkey (disabled by default),
  80.    and then the letter corresponding to the Menu function you want to access.
  81.    Any other key than a letter will cancel the action.
  82.  
  83. 5) You can configure Macro5 to set the backlight and the display contrast
  84.    when the machine is switched on. It possible to activate or deactivate the backlight
  85.    and the contrast settings. Parameters are different for the day and the night times.
  86.    Of course, the Night Time has to be greater than the Day Time.
  87.  
  88. 6) It is also possible to define macros that will be run either at switch on (can be
  89.    once a day) or at Macro5 startup.
  90.  
  91. I have set up by default Fn+Del for the TaskList and Fn+N for the Shortcuts because
  92. they are the same on the different keyboard layouts. But I find more convenient
  93. to use only one modifier (Ctrl) and to affect the hotkeys to non-letter keys around
  94. the right of the Space Bar, like "Ctrl+?" & "Ctrl+," on the US keyboard and
  95. "Ctrl+:" & "Ctrl+;" on the French keyboard. The Ctrl+Shift hotkey is disabled by default.
  96. I have not set a toolbar to keep the program as small as possible.
  97.  
  98. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  99. !!! I have added a hotkey to switch back to Macro5 but I think it is better to assign !!!
  100. !!! it to a silkscreen key (is set up in the System Control Panel->Extras).           !!!
  101. !!! This way the same 'hotkey' allows you to switch back to Macro5 and to restart it  !!!
  102. !!! when it's not running (after a backup).                                           !!!
  103. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  104.  
  105.    File Menu :
  106.    ----------
  107.       + Go to background - Ctrl+B or Esc : send Macro5 to background
  108.       + Close - Ctrl+E : exit Macro5
  109.  
  110.    Shortcuts Menu:
  111.    ---------------
  112.       + Modify - Ctrl+M or enter : edit the selected shortcut
  113.       + Move - Ctrl+X : reassign the shortcut to a new key
  114.       + Delete - Ctrl+H or Del : delete the selected shortcut
  115.       + New macro - Ctrl+N : create and open a new source file for a macro
  116.       + Open macro - Ctrl+O : edit the source file of the selected shortcut
  117.       + Record macro - Ctrl+R : record your keystrokes in a new source file
  118.  
  119.       You select a shortcut either with the arrows or by typing directly the letter of
  120.       the shortcut. You switch from one panel to the others with 'Tab' or the arrows.
  121.       Notice that Enter edit the current shortcut and does not run it.
  122.       Press the Shortcuts hotkey for that. When you create or edit a shortcut,
  123.       you specify first the Caption, which is the label put on the reminding panels,
  124.       and the type of the shortcut. Then you enter the attributes of the shortcut.
  125.  
  126.       A shortcut may be a :
  127.          + direct access to a document : to be used when the file you want to open is
  128.            a document linked to an application : it has the same icon than its
  129.            application and it may be run by selecting it with the explorer (e.g. Data,
  130.            Word and spreadsheet files).
  131.          + direct access to a program : to be used when the application is not document
  132.            oriented (e.g. Calc, Shell, Time, games, utilities). Notice that you may
  133.            switch to the system by running : "z:\System\Apps\Shell\Shell.app".
  134.          + text to paste : can be any text up to 255 characters, plus the following
  135.            keywords :
  136.               + %%country%% : insert the name of the current home country.
  137.               + %%city%% : insert the name of the current home city.
  138.               + %%date format%% : insert the current date as specified by format.
  139.                 format may a combination of any characters plus :
  140.                   +DD : day of the month (1 to 31)
  141.                   +MM : month (1 to 12)
  142.                   +YY : year on 4 digits
  143.                   +yy : year on 2 digits
  144.                   +DN : full day name
  145.                   +dn : 3-letter day name
  146.                   +MN : full month name
  147.                   +mn : 3-letter month name
  148.                 e.g. %%date DD/MM/yy%% pastes 21/12/97
  149.                 rem  %%date%% is equivalent to %%date dn DD mn YY%%
  150.               + %%time format%% : insert the current time as specified by format.
  151.                 format may a combination of any characters plus :
  152.                   +HH : hours in 24 format
  153.                   +hh : hours in 12 format
  154.                   +MM : minutes
  155.                   +SS : seconds
  156.                   +AP : AM/PM
  157.                 e.g. %%time hh:MM:SS AP%% pastes 01:23:45 PM
  158.                 rem  %%time%% is equivalent to %%time HH:MM:SS%%
  159.               + %%query question_text%% : open an input box with the label "question_text"
  160.                 and paste the input text.
  161.            You can use as many keywords as you want. This way you may prepare small
  162.            documents (e.g. email) that are customized on the spot. This version is
  163.            limited to 255 characters, but by programming a macro with several paste
  164.            commands, you can create large documents. If you ask for it, I will try
  165.            to remove this limit. If you think of some new useful keywords, don't
  166.            hesitate to send me an email. Macro5 is improved through your feedback.
  167.          + macro to execute : look below how to program macros.
  168.          + bookmark : allow you to access directly folders of any drive (even the ROM).
  169.          + keystroke : used for remapping keys.
  170.  
  171.       When you record a macro, you are first prompted for its name (must be a new file)
  172.       and for the task you want to work on (you have the option of not recording
  173.       this switch). If you want to switch to the system screen or any other standard
  174.       application, select it in Z:\System\Apps. Then enter your sequence of key and
  175.       pen strokes. When you are done, stop the recording with the hotkey used for
  176.       the Shortcuts and a program editor will pop up with the code of the macro.
  177.       While recording, do not switch to another task with the application keys,
  178.       the system tasklist or the silkscreen keys but use the TaskList or TaskCycling
  179.       hotkeys instead. If you loose the blinking message "Recording macro...", get it back
  180.       by switching to Macro5 with the system tasklist.
  181.       I'm aware that the text cursor is not visible during the record of a macro
  182.       but so far I have not been able to find a workaround.
  183.  
  184.    View Menu :
  185.    -----------
  186.       + Shortcuts panels - Ctrl+Y : if activated, the shortcuts panels will pop up
  187.         each time you press one of the 3 Shortcuts hotkeys. Otherwise they will only
  188.         pop up when pressing a non-letter key or a not assigned key.
  189.       + Switch view : select how shortcuts panels are displayed.
  190.  
  191.    Tools Menu :
  192.    ------------
  193.       + Preferences - Ctrl+K : define the options for setting the display at switch on.
  194.         The "Turn backlight on when main power" option uses the night contrast setting.
  195.       + Hotkeys ->
  196.          + User defined - Ctrl+U : assign your most used shortcuts to hotkeys.
  197.          + System - Ctrl+S : set the system hotkeys :
  198.             + First Panel : run a shortcut in the first panel
  199.             + Second Panel : run a shortcut in the second panel
  200.             + Third Panel : run a shortcut in the third panel
  201.             + TaskCycling : cycle through open tasks
  202.             + TaskList : display a tasklist
  203.             + Ctrl+Shift : active the Ctrl+Shift capability
  204.             + Macro5 : switch back to Macro5 itself
  205.         Hotkeys can be any of the silkcreen keys. Use 'Space' to call the list.
  206.         It is possible to disable any hotkey with the key 'Del'.
  207.         !!! Some very rare key combinations may return different keycodes when Caps Lock
  208.         is on or off. If you use your machine in both modes, watch for that (in the
  209.         hotkey setting try the key with and without Caps and check it is the same string).
  210.         Otherwise define your hotkeys with Caps set accordingly but it may happen that
  211.         one of your hotkeys will not work when you are in the other Caps mode.
  212.       + Advanced ->
  213.           + Macro at startup - Ctrl+V : execute the specified macro at Macro5 startup.
  214.             This feature is particularly useful after a backup or a reset, when you have
  215.             to restart all your favorite applications. If you have assigned an Extras bar
  216.             position to Macro5, they may all be restarted with one key stroke.
  217.             You may use the macro "Startup" that runs all the apps & docs
  218.             in \Startup, but it may be anything else (e.g. a sequence of FgApp%:()).
  219.           + Macro at switch on - Ctrl+W : execute the specified macro at switch on.
  220.             Use it to foreground an application at each switch on or when you want
  221.             something to be done or checked regularly. For example you can use the macro
  222.             NoLightOff that disable the backlight timer when the external power is
  223.             connected or you can write a macro that checks the battery status at each
  224.             switch on. You can add the option to run it only once a day.
  225.           + Macro folder - Ctrl+F : define the path of the folder where the macros are
  226.             stored. When you change it, Macro5 ask you to confirm the update
  227.             of the shortcuts paths.
  228.             !!! The system updates the shortcuts paths, but not the code of the macros.
  229.             Some macros may have to be updated as well.
  230.           + Panel captions - Ctrl+J : set the captions of the 3 shortcuts panels.
  231.           + Close for backup - Ctrl+Z : enable/disable the closing of Macro5 during the backups.
  232.             The advantage of keeping Macro5 running is that you will not have to restart it.
  233.             !!! The drawback is that, if Macro5 is running on the disk that is backed up,
  234.             you will get a message warning you that Macro5.app was not saved. The workaround
  235.             is to close Macro5 each first time you make a backup with a new release of Macro5.
  236.             As long as Macro5.app does not change, PsiWin will not try to save it and
  237.             you will not get any warning message.
  238.             !!! When Macro5 is set to stay open during the backups, it will not close when asked to
  239.             do so from the tasklist. To close it, you'll have to switch to it and quit.            
  240.           + Start in background - Ctrl+G : make Macro5 go to the background once it is started.
  241.       + Key summary - Ctrl+L : remind you the system hotkeys.
  242.       + Help on Macro5 - Ctrl+P : start the online help.
  243.       + About Macro5 - Ctrl+A : display information about Macro5.
  244.  
  245.  
  246. Programming of Macros :
  247. -----------------------
  248.  
  249. Macros are written and compiled with the standard program editor.
  250. The sources should be named *.opl and the binaries *.opo, both stored
  251. in \Macros (may be reconfigured). This naming is not mandatory but
  252. will allow you to access these files directly from Macro5.
  253. The language for the macros is the same than for any other OPL program.
  254. All the EPOC OPL & OPX commands are available, plus some new variables,
  255. constants and functions that will help you writing your macros :
  256.  
  257.    Variables :
  258.    -----------
  259.  
  260.    + Thread& : + is set at the start of a macro and by FgDoc, UseDoc, FgApp,
  261.                  BgApp, FgSystem and BgSystem.
  262.                + is used by FgCurrent, BgCurrent, TaskUid, TaskApp, TaskDoc,
  263.                  SendKey, SendString, SendPenClick, SendPenUp, SendPenDown,
  264.                  SendPenDrag, Paste, Copy, CopyWord, TaskUid, TaskApp, TaskDoc,
  265.                  SendRscMenu, SendRscButton and SendRscList.
  266.                + is the thread number of the task you want to work with.
  267.  
  268.    + Macros$ : + path of the folder where macros are stored.
  269.                + e.g. used by the macro Pen to load the bitmap of the cursor.
  270.                !!! do not modify it otherwise the file input boxes will not point
  271.                    to the correct folder anymore.
  272.  
  273.    Commands :
  274.    ----------
  275.  
  276.       + FgDoc%:(Doc$)
  277.          => + foreground the document Doc$ if in memory and open it otherwise.
  278.             + use it only with documents bound to applications (have the same icon
  279.               than their application and may be run by selecting them with the explorer).
  280.         + set Thread& to the corresponding ThreadId.
  281.         + return 0 if Doc$ was in memory, 1 if it has to be loaded
  282.               and -1 if an error occurred.
  283.  
  284.       + UseDoc%:(App$,Doc$,Cmd%)
  285.          => + switch to the document Doc$ if in memory and Cmd% < 3,
  286.               set Thread& to the corresponding ThreadId if in memory and Cmd% = 3,
  287.               and start App$ otherwise.
  288.             + Cmd%=0 for open, 1 for create, 2 for run and 3 for run in background.
  289.               Notice that the standard applications do not open Doc$ but the last
  290.               document when they are opened with Cmd%=3.
  291.             + set Thread& to the corresponding ThreadId.
  292.         + return 0 if Doc$ was in memory, 1 if it has to be loaded
  293.               and -1 if an error occurred.
  294.  
  295.       + FgApp%:(App$)
  296.          => + foreground the program App$ if in memory and run it otherwise.
  297.             + handle app, opo and application bound documents as well, but prefer
  298.               FgDoc when you know it is a document (is faster).
  299.             + set Thread& to the corresponding ThreadId.
  300.         + return 0 if App$ was in memory, 1 if it has to be run
  301.               and -1 if an error occurred.
  302.  
  303.       + BgApp%:(App$)
  304.          => + set Thread& to the corresponding ThreadId if in memory and run it
  305.               in the background otherwise. To be used when you want to send information
  306.               (SendKeyCode, Copy$, Paste) to an application but you don't want it
  307.               to be in the foreground yet (is faster).
  308.             + handle only programs (app & opo), not documents.
  309.             + set Thread& to the corresponding ThreadId.
  310.         + return 0 if App$ was in memory, 1 if it has to be run
  311.               and -1 if an error occurred.
  312.  
  313.       + FgSystem:
  314.          => + foreground System.
  315.             + set Thread& to the corresponding ThreadId.
  316.  
  317.       + BgSystem:
  318.          => + set Thread& to the ThreadId of System.
  319.  
  320.       + FgCurrent:
  321.          => + foreground the task with the ThreadId Thread&.
  322.          !!!! make sure that Thread& points to the correct task.
  323.  
  324.       + BgCurrent:
  325.          => + background the task with the ThreadId Thread&.
  326.          !!!! make sure that Thread& points to the correct task.
  327.  
  328.       + FgMacro:(Mac$)
  329.          => + execute the macro Mac$
  330.          !!!! Thread& keeps its current value.
  331.          !!!! you may not exceed 5 levels of macros calling other macros
  332.  
  333.       + FgSound:(Sound$,Volume%)
  334.          => + play the file Sound$, waiting for the end of the file before going on.
  335.             + 0 (no volume) =< Volume% =< 4 (maximum volume).
  336.  
  337.       + BgSound:(Sound$,Volume%)
  338.          => + play the file Sound$, going on without waiting the end of the file.
  339.             + 0 (no volume) =< Volume% =< 4 (maximum volume).
  340.  
  341.       + GetFocus:
  342.          => + when any Bgxxx commands is used, the corresponding task is foregrounded
  343.               and the macro is sent to the background. As a result all displays are now
  344.               in the background as well and all events redirected to the current task.
  345.               GetFocus return the focus on the macro when you need to display information
  346.               or input data.
  347.           !!! Thread& keeps its current value.
  348.  
  349.       + ReleaseFocus:
  350.          => + return the focus to the current task.
  351.             + you may use FgCurrent (or any Fgxxx) as well.
  352.          !!!! Thread& keeps its current value.
  353.  
  354.       + CloseApp%:(App$)
  355.          => + ask the application or document App$ to close (data are saved).
  356.             + return 1 if App$ was running and 0 otherwise.
  357.          !!!! if the application is not programmed to respond to closing events,
  358.               it will not go down.
  359.  
  360.       + KillApp%:(App$)
  361.          => + kill the application or document App$ (data are not saved).
  362.             + return 1 if App$ was running and 0 otherwise.
  363.          !!!! ALL DATA UPDATES IN THE APPLICATION MAY BE LOST !!!!
  364.  
  365.       + GetThread&:(App$)
  366.          => + return the thread ID of App$ if it is running and 0 otherwise.
  367.  
  368.       + GetApp$:(UID&)
  369.          => + return the full path of the program identified by UID.
  370.  
  371.       + TaskUid&:
  372.          => + return the program's UID pointed by Thread&.
  373.          !!!! make sure that Thread& points to the correct task.
  374.  
  375.       + TaskApp$:
  376.          => + return the program's name pointed by Thread&.
  377.          !!!! make sure that Thread& points to the correct task.
  378.  
  379.       + TaskDoc$:
  380.          => + return the path of the document used by the program pointed by Thread&.
  381.               return "" if the program does not use any document or has not declared it.
  382.          !!!! make sure that Thread& points to the correct task.
  383.  
  384.       + CurrentFolder$:
  385.          => + return the current folder in System.
  386.          !!!! this functions modifies the shell bookmark.
  387.  
  388.       + CurrentFile$:
  389.          => + return the current highlighted file in System.
  390.          !!!! this functions modifies the shell bookmark.
  391.  
  392.       + Copy$:
  393.          => + copy the selected text in the clipboard and return it.
  394.             + if the text is greater than 255 characters, only the first 255 are copied.
  395.          !!!! if no text is selected, Copy$ returns "".
  396.          !!!! make sure that Thread& points to the correct task.
  397.  
  398.       + CopyWord$:(CharList$):
  399.          => + copy the word around the cursor in the clipboard and return it.
  400.             + CharList$ is not case sensistive and lists the allowed characters in
  401.               the word. The selection is stopped ss soon as a not allowed character is found.
  402.               e.g. for : + a standard word, use "ABCDEFGHIJKLMNOPQRSTUVWXYZ-"
  403.                          + a procedure name, use "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_%&$:"
  404.                          + an URL, use "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_:\."
  405.                          + a number, use "0123456789.,"
  406.          !!!! Space or Tab CANNOT be allowed and always stop the selection.
  407.          !!!! make sure that Thread& points to the correct task.
  408.  
  409.       + Paste:(Text$)
  410.          => + put Text$ in the clipboard and paste it.
  411.             + the keywords %%date%%, %%time and %%query question_text%% may be used.
  412.          !!!! this command works only when the target task supports it.
  413.          !!!! make sure that Thread& points to the correct task.
  414.  
  415.       + ClipType&:
  416.          => + return the type of the object currently stored in the clipboard.
  417.  
  418.       + ClipLen&:
  419.          => + return the length of the text in the clipboard
  420.  
  421.       + ClipRead:(BufferAddr&,Max&)
  422.          => + put in Buffer the text in the clipboard, with a limit of Max& Characters.
  423.          !!!! Max& has to be a long integer. If you use a constant, either do it in hexa
  424.               and put '&' before or include "Macro.oph" for the OPL compiler to coerce
  425.               the parameters types.
  426.          !!!! make sure that Buffer is large enough to store Max& characters.
  427.          !!!! if you want to read the selected text,
  428.               use "SendKeyCode:(Ctl%+%c,Ctrl%,1) :Pause 5" before.
  429.  
  430.       + ClipWrite:(BufferAddr&)
  431.          => + put in the clipboard the text in Buffer.
  432.          !!!! if you want to paste the text in the current task,
  433.               use SendkeyCode:(Ctl%+%v,Ctrl%,1) after.
  434.  
  435.       + ClipReadBmp:(id%,x%,y%)
  436.          => + copy the bitmap stored in the clipboard to the window id% at x%,y%.
  437.  
  438.       + ClipWriteBmp:(id%,x%,y%,w%,h%)
  439.          => + copy to clipboard the bitmap defined by x%,y%,w%,h% to the window id%.
  440.  
  441.       + ClipClear:
  442.          => + empty the clipboard.
  443.  
  444.       + SendPenClick:(x%,y%)
  445.          => + emulate a click of the pen at x%,xy%.
  446.          !!!! make sure that Thread& points to the correct task.
  447.          !!!! this command foregrounds the corresponding task.
  448.  
  449.       + SendPenDown:(x%,y%)
  450.          => + emulate a pen going down at x%,xy%.
  451.          !!!! make sure that Thread& points to the correct task.
  452.          !!!! this command foregrounds the corresponding task.
  453.  
  454.       + SendPenUp:(x%,y%)
  455.          => + emulate a pen going up at x%,xy%.
  456.          !!!! make sure that Thread& points to the correct task.
  457.          !!!! this command foregrounds the corresponding task.
  458.  
  459.       + SendPenDrag:(x%,y%)
  460.          => + emulate a dragging of the pen to x%,xy%.
  461.          !!!! make sure that Thread& points to the correct task.
  462.          !!!! this command foregrounds the corresponding task.
  463.         
  464.       + SendKey:(KeyStr$)
  465.          => + send the corresponding key sequence to the task pointed by Thread&.
  466.             + the keywords are : Sh or Shift, Ct or Ctrl, Fn, Del, Tab, Enter,
  467.                                  Space, Esc, Menu, Up, Down, Right and Left.
  468.               they are not case sensitive (letters are).
  469.  
  470.             + e.g. to send: Ctrl+Fn+Left, Ctrl+Shift+Fn+Right, Ctrl+c (copy the whole text)
  471.                    use:     SendKey:("Ct+Fn+Left,Ct+Sh+Fn+Right,Ct+c")   
  472.  
  473.                    to send: Hello,[Enter]How are you ?
  474.                    use:     SendKey:("H,e,l,l,o,,,Enter,H,o,w, ,a,r,e, ,y,o,u, ,?")
  475.                    rem:     in this case, Paste:("Hello,"+Chr$(6)+"How are you ?")
  476.                             would be faster.
  477.  
  478.          !!!! make sure that Thread& points to the correct task.
  479.          !!!! KeyStr$ is limited to 255 characters. Use several SendKey if you need more.
  480.  
  481.       + SendString:(String$)
  482.          => + send String$ to the task pointed by Thread&.
  483.             + to be used instead of Paste: when String$ is short or when the target application
  484.               does not support the copy/paste functions.
  485.          !!!! make sure that Thread& points to the correct task.
  486.          !!!! keywords like %%date%% %%time and %%query%% are not supported by SendString.
  487.  
  488.       + SendRscMenu:(RscFile$,Pos%,Menu&)
  489.          => + read in RscFile$ the key referenced by Menu& and send it
  490.               to the task pointed by Thread&.
  491.             + to be used to call menu shortcuts.
  492.             + this allows the writing of language independent macros.
  493.             + e.g. to add a new record in a Data file :
  494.               SendRscMenu:("z:\System\Apps\Data\Data.rsc",4,&0d) will send
  495.               Ctrl+shift+N on the English machines but Ctrl+A on the French ones.
  496.             + you can get Pos% and Menu& with the provided macro RscMenuCode.
  497.          !!!! make sure that Thread& points to the correct task.
  498.  
  499.       + SendRscButton:(RscFile$,Pos%,Button%)
  500.          => + read in RscFile$ the key corresponding to Button% and send it
  501.               to the task pointed by Thread&.
  502.             + to be used to press buttons in dialogs.
  503.             + this allows the writing of language independent macros.
  504.             + e.g. to set the font when editing a record in a Data file :
  505.               SendRscButton:("z:\System\Apps\Data\Data.rsc",16,1) will send
  506.               Ctrl+F on the English machines but Ctrl+P on the French ones.
  507.             + Button% is the position of the button in the dialog (1 for the first).
  508.               I have not yet found a way to compute Pos% automatically. Send me a mail
  509.               with the description of the dialog you want to use this comand on.
  510.  
  511.             + e.g. to press the button No/Non/Nein...
  512.                    use : SendRscButton:("z:\System\Data\Eikon.rsc",308,1)
  513.  
  514.                    to press the button Yes/Oui/Ya...
  515.                    use : SendRscButton:("z:\System\Data\Eikon.rsc",308,2)
  516.  
  517.          !!!! make sure that Thread& points to the correct task.
  518.  
  519.       + SendRscList:(RscFile$,Pos%,List%)
  520.          => + read in RscFile$ the choice corresponding to List% and send it
  521.               to the task pointed by Thread&.
  522.             + to be used to select items in lists.
  523.             + this allows the writing of language independent macros.
  524.             + e.g. to turn off the link :
  525.               SendRscList:("z:\System\Apps\Shell\Shell.rsc",42,1) will select
  526.               'Off' on the English machines but 'DΘsactivΘe' on the French ones.
  527.             + List% is the position in the list of the item (1 for the first).
  528.               I have not yet found a way to compute Pos% automatically. Send me a mail
  529.               with the description of the dialog you want to use this comand on.
  530.          !!!! Only the first character is used for the selection. If several items begin
  531.               with the same character, the first in the list will be selected.
  532.          !!!! make sure that Thread& points to the correct task.
  533.  
  534.       + KeyString$:(Key%,Mod%)
  535.          => + return the caption of the key defined by ev&(1) and ev&(4) in GetEvent32.
  536.  
  537.       + KeyMod&:(EvMod%)
  538.          => + translate the Modifiers Code returned by GetEvent32 in ev&(4).
  539.               to the Modifers Code used by SendKeyCode and CaptureKey.
  540.  
  541.       + gClip:(Text$)
  542.          => + same as Busy, but does not blink.
  543.          !!!! make sure you've got the focus, otherwise nothing will appear.
  544.          !!!! if you make some graphical operations (e.g. gPrint, gLine, ...) between gClip:()
  545.               and gClipOff, insert a command 'gUse' after each gClip:() in order to switch back
  546.               to the windows you're working on.
  547.  
  548.       + gClipOff:
  549.          => + same as Busy Off but for gClip.
  550.  
  551.       + OPLCreate:(HdlAddr&,Files$)
  552.          => + create the OPL file Files$ with the handler Hdl%.
  553.  
  554.       + OPLWrite:(Hdl%,Text$)
  555.          => + write Text$ in the OPL file handled by Hdl%.
  556.  
  557.       + OPLClose:(Hdl%)
  558.          => + close the OPL file handled by Hdl%.
  559.  
  560.       + Log:(Message%)
  561.          => + write Message$ in c:\Logs\Macro5.txt
  562.  
  563.       + ViewLog:
  564.          => + display c:\Logs\Macro5.txt in a window.
  565.  
  566.       + ClearLog:
  567.          => + delete c:\Logs\Macro5.txt
  568.  
  569.       + CopyScreen:(id%,posX%,posY%,x%,y%,w%,h%)
  570.          => + copy the current screen area defined by x%,y%,w%,h%
  571.               to the window id% at posX%,posY%.
  572.  
  573.       + SetDictaphoneLed:(state%)
  574.          => + turn On/Off the red LED of the dictaphone.
  575.             + the LED is automatically turned off when the machine switches off.
  576.  
  577.       + Beep:
  578.          => + sound a nice beep.
  579.  
  580.       + LibVersion%:
  581.          => + display the version of the Macro5 library.
  582.  
  583. Notice that a macro is seen as a part of Macro5 (that's why you are able to
  584. access some global variables and new functions) and consequently, as long as the
  585. macro is running, Macro5 is not available for an other switch or lighting up
  586. the display at switch on. The purpose of a macro is to automate straight tasks.
  587. If you think of something more complex, then program an app and define a shortcut
  588. to run it. Do not use macros to access Macro5 : because Macro5 is busy executing
  589. the macro, it will not react to the sent events.
  590. You may not program Macro5 to switch to itself.
  591. If you get strange results or the target application crashes when using Copy/Paste
  592. or SendKey commands, try to add pauses to let the target application catch up.
  593. If you think of new functions that would help writing macros, please send me an email.
  594. And if you write useful macros, please think that it may benefit to others.
  595. Either publish them on the web or send them to me and I will upload them on my site.
  596. I have included some examples as a tutorial :
  597.  
  598.    + Battery : display the battery statistics : show you how to send keys to an App.
  599.    + LinkOn : set on the link : show you how to send keys to an App.
  600.    + LinkOff : set off the link : show you how to send keys to an App.
  601.    + UpperCase : set to uppercase the text you've selected : show you how to handle
  602.                  the clipboard functions.
  603.    + DataLink : seach a data file (e.g. address book) for the selected text :
  604.                 show you how to link data spread over several applications.
  605.    + OPLHelp : display the usage of a keyword you've selected in the OPL Editor (*) :
  606.                show you how to link data spread over several applications.
  607.    + FileTime : change the time stamp of a file : show you how to use OPL in a macro.
  608.    + RunExtras : run applications in the Extras bar without the pen : show you how
  609.                  to start programs.
  610.    + RunMacro : run not assigned macros : show you how to run macros.
  611.    + Startup : start all the App/Doc in c:\Startup. Very useful after a backup
  612.                with PsiWin or a reset. Can be used with Shortcut.app or XtraLink.app.
  613.    + NoLightOff : disable the backlight timer when the main power is present. To be
  614.                   used as a 'Run macro at switch on'.
  615.    + BatStat : display a graphical status of the main batteries for 2 seconds.
  616.                to be used as a 'Run macro at switch on'
  617.    + BatStatLow : same as BatStat but display the status only when the batteries are low.
  618.    + RscMenuCode : compute the parameters Pos% and menu& required by SendRscMenu.
  619.    + ExtrasBar : allow to display the Extras-bar when its key is used as a hotkey.
  620.    + Pen : emulate the pen with the keyboard : no more using of the back
  621.            of your fingernails :
  622.  
  623.               + arrows => move the cursor
  624.               + space => click
  625.               + ctrl+arrows => drag (ctrl down, move, ctrl up)
  626.               + shift+space => space
  627.               + shift+arrows => arrows
  628.               + shift+esc => quit
  629.               + any other key => key
  630.  
  631.    (*) : you need the "OPL reference" database file.
  632.  
  633. Please have a look at them before writing your own procedures. I hope they cover
  634. all the new commands. If you have any questions, please feel free to contact me
  635. and I will do my best to reply you as soon as possible. Because you can do almost
  636. anything with macros, you should watch what you are doing and backup your data.
  637.  
  638. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  639. !!! If you get the error message 'ppp procedure not found' where ppp is one   !!!
  640. !!! of the macro functions (BgSystem, FgCurrent, ...), it means either that   !!!
  641. !!! you did not select the type "macro" in the shortcut definition, or you're !!!
  642. !!! trying to run the macro directly from the program editor or the system.   !!!
  643. !!! A macro cannot be run directly after a translation or by selecting it     !!!
  644. !!! in the explorer, but must be executed through a shortcut in Macro5.       !!!
  645. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  646.  
  647.  
  648. Known issues :
  649. --------------
  650. + When you press 'Tab' in a file select box and the directory is system,
  651.   the app crashes. It seems to be an EPOC bug and I can't do anything about it.
  652. + When Macro5 is busy doing something (open dialog or menu,
  653.   running macro), neither the hotkeys or the display settings works.
  654.   Consequently, do not keep open a dialog box and write straight macros.
  655. + The text cursor is not visible when a macro is being recorded. So far I have not
  656.   been able to find a workaround.
  657. + Macro5 is not restarted after a backup by PsiWin. This is a known bug of
  658.   PsiWin 2.1 that will only restart the applications in the ROM (Z:).
  659.   It is fixed in PsiWin 2.2.
  660.  
  661.  
  662. Copyright :
  663. -----------
  664. This program has been written by Pascal NICOLAS. It may be distributed
  665. freely as long as it is not altered or sold. This program is a SmileWare,
  666. which means that if you use it, you "MUST" send me a :-)
  667. Even if you did it for a previous release, please tell me how you find
  668. this new version : I do love :-) very much. I will then notify you of
  669. the new releases.
  670.  
  671. At this point, many many thanks and :-) to MattM who helps me a lot in the
  672. enhancement of Macro5. Thank you also to Dominique Faure who wrote Macro5.hlp
  673.  
  674. And thank you to all of you who send me comments, new ideas, :-) and encourages
  675. me to go on.
  676.  
  677. Pascal NICOLAS
  678. Email : pnicolas@geocities.com
  679. Latest version and a huge library of macros at http://www.geocities.com/SiliconValley/Pines/1215