[comp.sys.mac.misc] Bulk UnBinHex/UnStuff script for Stuffit Deluxe

tonyrich@titanic.cs.wisc.edu (Anthony Rich) (02/27/91)

Here's a simple Stuffit Deluxe script to automatically unBinHex and
unStuff all the .hqx files in a certain folder.  The script assumes all
the files are in a top-level folder named "Downloads" on your Mac, and
you DO have to combine multi-part .hqx files some other way BEFORE you
run this script.  All lines starting with "--" are comments and can be
left in the script as-is if desired.

To install it, just put the script anywhere on your hard disk (or whatever
you use for a startup disk), launch Stuffit Deluxe, then pull down the
"Script" menu and select "Add Script to Menu...".  Navigate to wherever
you put the script, select it, and click ADD.  Now you can run the script
by selecting its name from the Script menu.

You can edit the script with any text editor (even after it's installed),
but if you do, always save it as a plain TEXT file (not as a Word 4.0
document, for example).

Enjoy!  -- Tony Rich (tonyrich@cs.wisc.edu)

Here's the script:

------------------------------------------------------------------------
-- Stuffit Deluxe script to UnBinHex and UnStuff all .hqx files that
-- are in a top-level folder named "Downloads" on the startup disk.
--
-- NOTE: Combine any multi-part .hqx files in the Downloads folder
--       BEFORE running this script.  Otherwise the script will try to
--       unBinHex the parts separately; it will report a CRC error when
--       it tries to unBinHex the first incomplete part and then fail.
------------------------------------------------------------------------

-- Put Stuffit progress messages into the file "Stuffit Deluxe Msgs".
-- This step isn't essential, but the messages can be informative if
-- something goes wrong while the script is executing.

Write Status To "{Startup}Downloads:Stuffit Deluxe Msgs"

-- Set the destination for UnBinHexed files to be the Downloads folder.

Destination "{Startup}Downloads:"

-- Decode all .hqx files in the "Downloads" folder and leave them there.
-- The Decode BinHex command doesn't have a "delete" option, so the .hqx
-- files will still be there when this script is finished.  Some files
-- may not be .sit files after UnBinHexing, but that's okay.

Decode BinHex "{Startup}Downloads:*.hqx"

-- Now QuickUnStuff all the resulting files that end in ".sit", deleting
-- the .sit files as they are processed.  QuickUnStuff is used instead
-- of plain UnStuff so that each set of unstuffed files is placed in its
-- own folder.

QuickUnStuff "{Startup}Downloads:*.sit" delete

-- Quit Stuffit Deluxe.

Quit

---------------------------- End of Script -----------------------------

alobar@ucscb.UCSC.EDU (66532000) (02/28/91)

A side note to the bulk UnBinHex/UnStuff script posted earlier:

It is also possible to set up a StuffIt Deluxe script so that you
can launch it by double clicking on it in the finder.  All you
need to do is set the creator to 'SIT!'.  The type always needs
to be 'text'.  Now double clicking the script will launch StuffIt
Deluxe and execute the script.  If you also add a 'quit' command
to the end of the script, StuffIt will quit when the script has
completed.

johnston@oscar.ccm.udel.edu (Bill Johnston) (02/28/91)

In article <12909@darkstar.ucsc.edu>, alobar@ucscb.UCSC.EDU (66532000) writes...

>A side note to the bulk UnBinHex/UnStuff script posted earlier:
>It is also possible to set up a StuffIt Deluxe script so that you
>can launch it by double clicking on it in the finder.  All you
>need to do is set the creator to 'SIT!'.

The "record script" option does this automagically.  You can record
some or all of the task you wish to automate, and then tweak the
script with a text editor for completeness or generality.

-- Bill Johnston (johnston@oscar.ccm.udel.edu)
-- 38 Chambers St.; Newark, DE 19711; (302)368-1949