Stuffit Expander expand AppleScript failing


I know that Stuffit Expander (16.0.6) has not been recently updated (and probably is not going to be).
I’ve got a pwd protected file ( from 2009 ?) which I’ve forgotten the pwd of, and I would like to write a script to work along a list of “potential pswd” (too long to use one by one).

When using the AppleScript on a test file which has “toto” as pwd

tell app “Stuffit Expander”
set theResult to expand “/Users/xxxx/Desktop/Test.rtf 1.sitx” to “/Users/xxxx/Desktop/test1.txt” password “toto”
end tell

I very often get this :error message : [0x0,38f68f3 “StuffIt Expander”] stuffit engine error : -54

In facts it sometimes work, but when it has failed it does this repeatedly until ??(close my session and reopen : doesn’t work)

Is there any solution ? Thank you for help

Let’s crack the password here and now. And, as fast as possible. :lol:

Step 1) In the preferences of Stuffit Expander set option “Expand archives to:” to be “Same location as source archive”. Now, we don’t need specify the location in the code.

Step 2) To avoid interruption of cracking due the errors, let’s use try blocks:

set anSitxArchive to ((path to desktop folder) as text) & "Test.rtf 1.sitx"
set myPassword to "toto"

tell application "StuffIt Expander"
		expand anSitxArchive
		display dialog "Success! This SITX archive isn't protected with password"
	on error
		repeat with i from 1 to 100
				expand anSitxArchive password myPassword
				display dialog "Success! The password is " & "\"" & myPassword & "\""
			on error
				set myPassword to "toto" & i
			end try
		end repeat
	end try
end tell

display dialog "No password cracked. Try other wordlist to crack the password"

NOTE: Advanced cracking -providing progress bar :lol:

Thanks a lot, it works…
In my script which I didn’t reproduced completely the instructions were in a try loop, but somehow the script failed with the error I stated.
Thanks again, I will have to process my list of potentiel passwords…