Part of the Samples Website. 8/16/97.

samples.basicStuff.smoothStuffer

«Shows how to create a StuffIt archive of a folder
«it makes sure the file name isn't > 31 characters
«the limit of the Mac file system
«deletes the archive if it already exists
«so StuffIt.newArchive won't fail
if not app.start ("StuffIt")
scriptError ("You must run the StuffIt.Frontier install file first.")
local (sourcefolder)
if not file.getFolderDialog ("Choose a folder to Stuff", @sourcefolder)
return
«determine the name we're going to suggest
local (name = file.fileFromPath (sourcefolder) - ":")
if sizeOf (name) > 27 «don't exceed max file name length
name = string.mid (name, 1, 27)
local (archive = file.getPath () + name + ".sit")
if not file.putFileDialog ("Name of StuffIt archive:", @archive)
return
if file.exists (archive)
file.delete (archive)
StuffIt.newArchive (archive, false)
StuffIt.bringToFront ()
StuffIt.stuffItem (sourcefolder)
StuffIt.closeArchive (string (archive))
StuffIt.quit ()


This page was last built on Sat, Aug 16, 1997 at 6:41:04 PM. You can download the current set of sample scripts from our FTP site. Dave