home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus5 / DC-OP55B.LZX / Opus5 / modules / DOpusPack_Link.dopus5 < prev    next >
Encoding:
Text File  |  1996-07-18  |  4.0 KB  |  127 lines

  1. /* DOpusPack_Link for Directory Opus 5.5
  2.    by Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.    email: leo.davidson@keble.oxford.ac.uk  www: http://users.ox.ac.uk/~kebl0364
  4.  
  5. $VER: DOpusPack_Link.dopus5 1.0 (13.7.96)
  6.  
  7.    Adds "pack" and "unpack" commands to Directory Opus 5.5 or above.
  8.  
  9.    This script must go in the DOpus5:Modules directory. The DOpusPack_Main
  10.    executable must be in the command-path (or made resident). DOpus5:c/ should
  11.    be in the command-path so you can leave it in there.
  12.  
  13.  
  14.    Before you will be able to get this to work you will need to have installed
  15.    the XPK compression system on you machine. You can find XPK on Aminet or
  16.    any other good public domain software archive.
  17.  
  18.  
  19.    Once installed you will get two new commands:
  20.  
  21.  
  22. 1) "Pack" -- Argument: "Mode/K"
  23.  
  24.    This command will compress all selected files in the source directory
  25.    using the XPK library you specify with the Mode argument (see the XPK
  26.    docs for more information).
  27.  
  28.    For example, to make a button which compresses files with the "NUKE"
  29.    XPK library, have this:
  30.  
  31.     [Command]    Pack NUKE
  32.     Flags:        Rescan SOURCE
  33.  
  34.    You can also specify efficiency/mode xxx in the usual way by writting
  35.    NAME.xxx. (See the XPK docs if you don't understand, or don't worry about
  36.    this as it isn't very important for most users).
  37.  
  38.    If you specify an XPK library such as IDEA which encrypts files you
  39.    will be requested for a password.
  40.  
  41.  
  42.  
  43. 2) "UnPack" -- No Arguments.
  44.  
  45.    This command will uncompress all selected files in the source directory
  46.    which have been compressed with XPK. For a button which unpacks files,
  47.    use this:
  48.  
  49.     [Command]    UnPack
  50.     Flags:        ReScan SOURCE
  51.  
  52.    If an encrypted file is found you will be asked for the password to
  53.    decrypt it. This password will then be used for ALL other encrypted
  54.    files which were also selected. In the future you may be able to
  55.    specify whether to be prompted for the passwords of other files.
  56.  
  57.    In the future I may extend the UnPack command to drop back to using
  58.    xfdmaster.library when a file cannot be decompressed. I'm not sure
  59.    if I'll bother implimenting this, though. Any requests?
  60.  
  61.    Another possible future addition is an "XPKDoubleClick" command
  62.    which first decrunches the file and then executes the DoubleClick
  63.    action defined for whatever type of file the result is.
  64.  
  65.    Advanced users: It is safe to setup one of the UserX commands as
  66.    your "decrunch" command and to put "UnPack" as the UserX command
  67.    of your XPK filetype. Most of the time, even if you have some
  68.    XPK files selected with some LhA (or other compressed) files, the right
  69.    things should happen. Be aware, though, that DOpusPack only looks at
  70.    which files are selected in the source lister (and deselects them),
  71.    and so any other thing which works in the same way will cause a
  72.    (harmless but irritating) clash. I'm using DOpusPack with many other
  73.    "decrunch" filetypes (all of which are just AmigaDOS commands and so
  74.    unaffected) without any problems.
  75.  
  76. --
  77.  
  78.    Example XPK filetypes for Directory Opus 5:
  79.  
  80. - - - - - - - - -
  81. Name: XPK Packed File
  82.   ID: XPKDATA
  83.  Pri: 0
  84.  
  85.       Match        XPKF
  86.       Or
  87.       Match        PP20
  88.  
  89. - - - - - - - - -
  90. Name: XPK IDEA Encrypted File
  91.   ID: XPKIDEA
  92.  Pri: 1            <- *IMPORTANT*
  93.  
  94.       Match        XPKF
  95.       And
  96.       Move To    8
  97.       Match     IDEA
  98. - - - - - - - - -
  99.  
  100.  
  101.  
  102. */
  103.  
  104. options results
  105. options failat 99
  106. parse arg portname function source_handle dest arguments
  107. address value portname
  108.  
  109. /* No version check as pre 5.5 doesn't support these scripts at all. */
  110.  
  111. Select
  112.     When function='init' then do
  113.         dopus command "Pack"    program "DOpusPack_Link" 'desc' "'Pack files with XPK'" 'source' template "MODE/K"
  114.         dopus command "UnPack"  program "DOpusPack_Link" 'desc' "'Unpack XPK files'" 'source'
  115.         end
  116.     When function='Pack' then do
  117.         if strip(upper(word(arguments,1))) = "MODE" then
  118.             arguments = delword(arguments,1,1)
  119.         if arguments ~= "" then
  120.             arguments = "PackMode" arguments
  121.         address command "DOpusPack_Main" portname source_handle "Pack" arguments
  122.         end
  123.     When function='UnPack' then
  124.         address command "DOpusPack_Main" portname source_handle "UnPack"
  125. Otherwise
  126.     End
  127.