Scripting StuffIt Deluxe 8.0.2

Here’s a script I wrote to compress files and move them to a backup disk. There are a couple of issues. The script basically works except for two items.

First, even though I have the with repeat in this line-
stuff {compfol1} into archive arch compression level maximum with replacing
-it doesn’t replace if the archive exists in the destination folder. I end up with my custom error message.

Second, if the name of the archive ends up being 27 characters or more long it gives me an error. StuffIt will compress these folders when I tell it to outside of the script without any errors. I’m figuring that this may have something to do with AppleScript. (1.9.3). This is on OS 10.3.5.

If anyone has some info it would be greatly appreciated.

Thanks

tell application "Finder"
	activate
	set compfoldest to folder "Completed Jobs" of folder "Desktop" of folder "admin2" of folder "Users" of startup disk
	set fol1 to folder "Make Plates" of folder "Desktop" of folder "admin2" of folder "Users" of startup disk as alias
	
	set cnt2 to the number of items in folder fol1
	
	--select folders to compress and compress them	
	repeat with i from 1 to cnt2
		set foldest1 to compfoldest as string
		set compfol to folder i of fol1 as string
		set compfol1 to compfol as alias
		--get the name of the folder to compress
		set nme to name of folder i of fol1 as string
		--set the name for the StuffIt archive
		set foldest to foldest1 & nme & ".sit"
		set arch to nme & ".sit"
		tell application "StuffIt Deluxe"
			with timeout of 600 seconds
				try
					make new archive with properties {location:file foldest, replacing:file foldest}
					stuff {compfol1} into archive arch compression level maximum with replacing
				on error
					tell application "Finder"
						activate
						display dialog "Item " & compfol1 & " was not compressed."
					end tell
				end try
			end timeout
		end tell
	end repeat
	
	tell application "StuffIt Deluxe"
		quit
	end tell
	
	-- change color of folders
	set label1 to the number of items in compfoldest
	repeat with i from 1 to label1
		set label index of file i of compfoldest to 2
	end repeat
	
	-- move compressed files to backup disk
	open file "OWC Neptune alias" of folder "Desktop" of folder "admin2" of folder "Users" of startup disk
	
	repeat with z from 1 to label1
		select file z of compfoldest
		set nme to selection
		set file_name to the name of file z of compfoldest as string
		set nme_compare to characters 2 through 5 of file_name as string
		if nme_compare is less than "2000" then
			move nme to folder "I0001 - I1999" of disk "OWC Neptune" with replacing
		else if nme_compare is less than "3000" then
			move nme to folder "I2000 - I2999" of disk "OWC Neptune"
		end if
	end repeat
	try
		close window "Desktop"
	on error
		display dialog "No window to close"
	end try
	try
		close window "OWC Neptune"
	on error
		display dialog "No window to close"
	end try
	try
		close window "Completed Jobs"
	on error
		display dialog "No window to close"
	end try
	
end tell