home *** CD-ROM | disk | FTP | other *** search
- /* DOpusPack_Link for Directory Opus 5.5
- by Leo 'Nudel' Davidson for Gods'Gift Utilities
- email: leo.davidson@keble.oxford.ac.uk www: http://users.ox.ac.uk/~kebl0364
-
- $VER: DOpusPack_Link.dopus5 1.0 (13.7.96)
-
- Adds "pack" and "unpack" commands to Directory Opus 5.5 or above.
-
- This script must go in the DOpus5:Modules directory. The DOpusPack_Main
- executable must be in the command-path (or made resident). DOpus5:c/ should
- be in the command-path so you can leave it in there.
-
-
- Before you will be able to get this to work you will need to have installed
- the XPK compression system on you machine. You can find XPK on Aminet or
- any other good public domain software archive.
-
-
- Once installed you will get two new commands:
-
-
- 1) "Pack" -- Argument: "Mode/K"
-
- This command will compress all selected files in the source directory
- using the XPK library you specify with the Mode argument (see the XPK
- docs for more information).
-
- For example, to make a button which compresses files with the "NUKE"
- XPK library, have this:
-
- [Command] Pack NUKE
- Flags: Rescan SOURCE
-
- You can also specify efficiency/mode xxx in the usual way by writting
- NAME.xxx. (See the XPK docs if you don't understand, or don't worry about
- this as it isn't very important for most users).
-
- If you specify an XPK library such as IDEA which encrypts files you
- will be requested for a password.
-
-
-
- 2) "UnPack" -- No Arguments.
-
- This command will uncompress all selected files in the source directory
- which have been compressed with XPK. For a button which unpacks files,
- use this:
-
- [Command] UnPack
- Flags: ReScan SOURCE
-
- If an encrypted file is found you will be asked for the password to
- decrypt it. This password will then be used for ALL other encrypted
- files which were also selected. In the future you may be able to
- specify whether to be prompted for the passwords of other files.
-
- In the future I may extend the UnPack command to drop back to using
- xfdmaster.library when a file cannot be decompressed. I'm not sure
- if I'll bother implimenting this, though. Any requests?
-
- Another possible future addition is an "XPKDoubleClick" command
- which first decrunches the file and then executes the DoubleClick
- action defined for whatever type of file the result is.
-
- Advanced users: It is safe to setup one of the UserX commands as
- your "decrunch" command and to put "UnPack" as the UserX command
- of your XPK filetype. Most of the time, even if you have some
- XPK files selected with some LhA (or other compressed) files, the right
- things should happen. Be aware, though, that DOpusPack only looks at
- which files are selected in the source lister (and deselects them),
- and so any other thing which works in the same way will cause a
- (harmless but irritating) clash. I'm using DOpusPack with many other
- "decrunch" filetypes (all of which are just AmigaDOS commands and so
- unaffected) without any problems.
-
- --
-
- Example XPK filetypes for Directory Opus 5:
-
- - - - - - - - - -
- Name: XPK Packed File
- ID: XPKDATA
- Pri: 0
-
- Match XPKF
- Or
- Match PP20
-
- - - - - - - - - -
- Name: XPK IDEA Encrypted File
- ID: XPKIDEA
- Pri: 1 <- *IMPORTANT*
-
- Match XPKF
- And
- Move To 8
- Match IDEA
- - - - - - - - - -
-
-
-
- */
-
- options results
- options failat 99
- parse arg portname function source_handle dest arguments
- address value portname
-
- /* No version check as pre 5.5 doesn't support these scripts at all. */
-
- Select
- When function='init' then do
- dopus command "Pack" program "DOpusPack_Link" 'desc' "'Pack files with XPK'" 'source' template "MODE/K"
- dopus command "UnPack" program "DOpusPack_Link" 'desc' "'Unpack XPK files'" 'source'
- end
- When function='Pack' then do
- if strip(upper(word(arguments,1))) = "MODE" then
- arguments = delword(arguments,1,1)
- if arguments ~= "" then
- arguments = "PackMode" arguments
- address command "DOpusPack_Main" portname source_handle "Pack" arguments
- end
- When function='UnPack' then
- address command "DOpusPack_Main" portname source_handle "UnPack"
- Otherwise
- End
-