Issue scripting batch expansion of archives

I tend to get a lot of archived files and I’ve found that if you open them all at the same time, OSX’s archive utility and StuffIT Expander both just try to unarchive every opened file at the same time. This leads to issues… so, I’m trying to script StuffIT Expander to take them on one at a time, but I can’t even get it to expand one file… What am i doing wrong? I don’t mind just manually throwing together a list of files to unarchive, but it’s telling me, “StuffIt Expander got an error: Connection is invalid.”

tell application "StuffIt Expander" to expand "file path" to "file destination"

I requested the book Applescript: The Missing Manual from the library so hopefully I’ll have less newbish questions in the future >.< Thanks for taking the time to help me

Hi,

it works, if the file list and the destination location are of class alias

set filePath to choose file with prompt "Choose file(s) to expand" with multiple selections allowed without invisibles
--> alias {path:to:file1, path:to:file2, ...}
set fileDestination to choose folder with prompt "choose destination folder"
--> alias "MacHD:Users:myUser:path:to:Folder:
tell application "StuffIt Expander" to expand filePath to fileDestination