REBOL [ Title: "Script compressor" Purpose: {Ask for the name of a script, read it, compress it, mold it into a displayable format, and put it on the clipboard. This is a coding aid.} ] ;; ----------------------------------------------------------------------------] ;; [ This is a very simple operation, but it has been packaged in to a ] ;; [ script so that it can be invoked by running this script, which will ] ;; [ be faster than starting REBOL, going to an appropriate directory, ] ;; [ typing the command, and so on. Little scripts like this can be put ] ;; [ behind buttons on a launcher window and used as coding aids when ] ;; [ when writing programs. ] ;; [ ] ;; [ For example, if you want to put a compressed script into a program, ] ;; [ you could code... ] ;; [ ] ;; [ COMPRESSED-SCRIPT: _ ] ;; [ ] ;; [ ...and then run this program to load the clipboard with a displayable ] ;; [ (molded) compressed script, and then just press Ctrl+V in the editor. ] ;; [---------------------------------------------------------------------------] if not FILE-ID: request-file/only [ alert "No file requested." quit ] system/options/binary-base: 64 write clipboard:// mold compress read FILE-ID alert "Clipboard loaded."