home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / kmmepm04.zip / kenMMepm.doc next >
Text File  |  1996-04-12  |  11KB  |  186 lines

  1. (Note:  this file has been enhanced for EPM.  For best results, use Info-Zip to 
  2. unpack the zipfile, which will save the extended attributes, and use black type on a 
  3. light grey background in EPM.)
  4.  
  5.                                       kenMMepm
  6.  
  7.     Thanks for trying this EPM extension!
  8.  
  9. Overview     
  10.      kenMMepm adds the ability to quickly select the name of a multi-media file
  11. (or Internet URL) embedded in a text file and automatically launch the appropriate 
  12. application for viewing/listening to/accessing that file.  
  13.  
  14.      The file name can be selected by either of two methods:
  15.      1.  The easiest way is to simply put the cursor anywhere within the filename 
  16. and select the "MMedia" menu item.  The EPM macro will automatically find the 
  17. beginning and end of the filename and then launch an application for viewing the 
  18. file.  (Note:  don't be alarmed when you see a locate circle appear and the cursor 
  19. jump to another line.  Be patient, and the cursor will return to its original spot 
  20. after a few seconds.) 
  21.     2. Use a character mark to highlight the name of the file, and then select the
  22. "MMedia" menu item to automatically launch an application for displaying the file.
  23. This is the method to use if the filename (or URL) has embedded spaces or funky
  24. characters in it.
  25.  
  26. New in this release (kenMMepm04)
  27.     Improvements have been made to the FTP and Gopher sections:  kenMMepm now
  28. automatically resolves the host name and remote directories.
  29.     It's also now easier to set up an alternate program (such as WebEx) as the FTP
  30. client, instead of using the default FTPPM.EXE.
  31.  
  32. How it works
  33.     kenMMepm stores the fully qualified name (including the extension) of the
  34. selected file name in a variable called "dataname", and also stores the extension in
  35. a variable called "DataExt".  The messageline at the bottom of EPM will keep you
  36. informed of what kenMMepm is using as the "dataname".  
  37.     kenMMepm will first examine "dataname" to see if it's a URL and, if so, will
  38. strip off the beginning of the URL ("gopher://", "telnet://", etc.)  when appropriate
  39. and then launch an Internet app, passing the "dataname" to the app.
  40.     If the "dataname" isn't an URL, kenMMepm next checks to see if "dataname"
  41. includes the "@" symbol.  If it does, the "mailto:"  phrase is added to the beginning
  42. of it, and WebEx is called for sending mail.
  43.     If "dataname" isn't a URL or "mailto" item, kenMMepm will then look at "DataExt"
  44. and, based on the extension (and the configuration you previously set), it launches
  45. an application and passes the file name to that app for processing.  The application
  46. can be a viewer (for images) an audio player, a spreadsheet program, etc.
  47.  
  48. Getting Started
  49.      Requirements:  You'll need a version of EPM above 6, and most likely it'll have 
  50. to be at least 6.03a.  This is the version I used when writing & testing the code.
  51.      Configuring kenMMepm:  This is a three-step process:  writing the names of 
  52. your applications into the kenMMepm.e file; compiling that file into a kenMMepm.ex 
  53. file; and linking kenMMepm.ex into your copy of EPM. 
  54.  
  55.      Adding your applications
  56.     If you're unfamiliar with the E macro language, there's plenty of info available
  57. in the EPMUSERS.INF and EPMTECH.INF references.  For our purposes here, you need to
  58. know that putting a semi-colon in the first column of a line makes that line a
  59. comment and it's ignored.  (You can see an example of this in kenMMepm.e where I've
  60. "commented out" a few lines that refer to the Windows apps on my system.)  Also, any
  61. literal string you want to be passed to the application (or to OS/2) must be enclosed
  62. in quotes.
  63.      The only section of kenMMepm.e that you'll need to deal with is near the
  64. beginning -- all those "elseif...then" statements.  
  65.  
  66.      Internet apps
  67.     For example, let's look at the lines that launch a Telnet session:
  68.    elseif upcase(leftstr(dataname, 9))='TELNET://' then
  69.       dataname=substr(dataname, 10)  -- this line strips out the URL type
  70.       'start /F linkup.exe telnetpm.exe "'||dataname'"'
  71.     You don't have to do anything to the first line (the "elseif" one).  This line is
  72. what figures out what type of URL it's dealing with.  The second line is the line
  73. that strips out the "telnet://" at the beginning of the URL, because TELNETPM.EXE
  74. doesn't use that part.  The third line launches the application, and it's in here
  75. that you'll need to replace the application name (if necessary) with the app you
  76. prefer to use.  (Whenever you're using WebEx in place of the other Internet apps,
  77. you'll need to "comment out" that line that strips out the URL type.)
  78.     You can go through the rest of the Internet section and make the changes you want
  79. for your setup.  You'll notice that I've used WebExplorer for newsgroups because it
  80. allows you to designate & read a specific newsgroup, even though you aren't
  81. subscribed to it.  I'm also using WebEx for sending mail, since it's real easy.  <G>
  82.     For FTP sessions, you have a choice of using FTPPM.EXE (the default) or
  83. WebExplorer.  At the beginning of kenMMepm.e is the constant FTP_APP which you can
  84. set to a value other than 'FTPPM.EXE' if you prefer using WebExplorer (or another FTP
  85. app).  If you do change this constant, be sure to change the appropriate lines in the
  86. Internet section lower down.  When using the default FTPPM.EXE, you'll want to set
  87. the constant "local_dir" to specify the directory on your machine to use for uploads
  88. & downloads.  Of course you also need to enter your own password (name@address)
  89. for anonymous log-ins.
  90.  
  91.      Other apps
  92.      The next section of kenMMepm.e sets up your other apps for viewing images, 
  93. listening to sounds, etc.  Let's look at the lines that launch an image viewer:
  94.    elseif pos(DataExt, 'GIF JPG BMP TIF') then
  95.       'start /F e:\os2apps\showgif.exe' dataname
  96.     The first line looks to see if the "DataExt" also appears in the character string
  97. 'GIF JPG BMP TIF'.  This saves space, since you don't have to list a separate "elseif
  98. DataExt='GIF'", etc., line for every possible file extension, as is done later in
  99. this section.  Just add your file extensions where appropriate (using all upper case)
  100. and change the application in the 'start ...'  line to suit your purposes.  You can
  101. (and probably will) need to add more lines.  Follow these examples and use the
  102. "elseif ...  then" construct, adding your lines before the indicated end of the "user
  103. changes" section.
  104.  
  105.      Compiling the macro
  106.      Use the ETPM.EXE program supplied with EPM.  The syntax is 
  107.      etpm <source directory>\kenMMepm.e <target directory>\kenMMepm.ex
  108. Use the same directory the other EPM *.ex files are in as your target directory.
  109.  
  110.      Linking the macro
  111.      There are a few different ways to do it:
  112.      1.  Bring up an EPM command line and enter:
  113.           link kenMMepm.ex
  114. This will add the "MMedia" item to the main menu bar.
  115.                                          or
  116.      2.  If you're using a PROFILE.ERX, and want kenMMepm loaded when you start 
  117. EPM, add the following line to PROFILE.ERX (the quotes are necessary):
  118.           'link kenMMepm.ex'
  119.                                          or
  120.      3.  If you've been re-compiling the main EPM macros to add your customizations, 
  121. add the following line to your MYSTUFF.E file (the quotes are necessary):
  122.           'link kenMMepm.ex'
  123.  
  124.     If you want to remove the macro, at an EPM command line enter:
  125.           unlink kenMMepm.ex
  126. That will remove the functionality of the macro and, in most cases, also remove the 
  127. "MMedia" item from the menu bar.
  128.  
  129.                          That's all there is to it!  Enjoy!
  130.              Send any comments, criticisms or suggestions to:
  131.                                     arway@wwa.com
  132.  
  133. General Hints and Tips
  134.      FTP:  FTPPM.EXE takes 16 starting arguments, corresponding to the entry fields 
  135. in the FTPPM Settings Notebook.  kenMMepm uses only the first 11 as follows:
  136.      Arg #1 is --->FTPPM.EXE<-----    Program name
  137.      Arg #2 is --->{host}<-----  Hostname
  138.      Arg #3 is --->anonymous<-----  User
  139.      Arg #4 is --->name@address<-----  Password
  140.      Arg #5 is --->0<-----  Account
  141.      Arg #6 is --->0<-----  Code Page (unchecked)
  142.      Arg #7 is --->{local_dir}<-----  Local directory
  143.      Arg #8 is --->{rem_dir}<-----  Remote directory
  144.      Arg #9 is --->*<-----  Local file mask
  145.      Arg #10 is --->*<-----  Remote file mask
  146.      Arg #11 is --->2<-----  Transfer type (ASCII=1 Binary=2)
  147.  
  148.      Gopher:  GOPHER.EXE needs the host name as a separate starting parameter.
  149. Therefore, if you've got a long string of sub-menus, kenMMepm will automatically
  150. split the URL after the host name with a space and the numeral "1" before passing the
  151. argument to GOPHER.EXE.
  152.      For example, if the original URL is:
  153. gopher://wx.atmos.uiuc.edu/Satellite Images/North America (GOES8-9 Composite) Visible (large=784x611)
  154.      after modification, the argument sent to GOPHER.EXE is:
  155. wx.atmos.uiuc.edu 1/Satellite Images/North America (GOES8-9 Composite) Visible (large=784x611)
  156.      (Of course you'll have to use the character marking method to highlight the 
  157. entire URL if it contains spaces.)
  158.  
  159. Tips for Power Users
  160.      If you know what you're doing and want the ultimate in convenience <G>, you can 
  161. add the "MMedia" item to the mouse popup menus instead of to the main menu bar.
  162.      First, you'll need to "comment out" several sections of code in kenMMepm.e:
  163.            Two of the lines in the "const" section, the six lines of the "definit" section,
  164.            and the four lines of the "defexit" section.
  165.     Second, add the two constants (KMM_MENU_MSG and KMM_MENUP_MSG) from kenMMepm.e to
  166. your MYCNF.E file.
  167.      Third, add the following two lines to your MOUSE.E file:
  168.       buildmenuitem menuname, 80, 8017, \0,                               '',          4, 0
  169.       buildmenuitem menuname, 80, 8026, KMM_MENU_MSG, 'get_dataname'KMM_MENUP_MSG, 0, mpfrom2short(0, 0)
  170.     Those lines go in four places (starting somewhere around line 1128 of MOUSE.E):
  171. in the "if filename = .tree" section, in the "Build inside-mark pop-up", the "Build
  172. outside-mark pop-up", and the "Build no-mark pop-up" sections.  The first line of
  173. code shown above creates a separator line across the popup menu.  Depending on where
  174. you want to place the "MMedia" menu item, if you need the separator line below the
  175. "MMedia" item just transpose those two lines.  Double check to be sure the submenu
  176. IDs (8017 and 8026) are unique for the popup section you're adding 'em to (you'll
  177. definitely have to change the IDs for the "if filename = .tree" section).  Then
  178. re-compile your main E macros.
  179.  
  180.      DISCLAIMER:  This program is supplied "as is", with no guarantee as to its
  181. appropriateness, suitability or functionality.  Use entirely at your own risk.  Under
  182.   no circumstances whatsoever will I be liable in any way for any damages, real or
  183.                          imagined, from use of this program.
  184.                               Copyright Ken Arway 1996
  185.  
  186.