Yvan explained how to get rid of the error. I found the following explanation as to why it occurs:
Error -10004 is an Apple Event Privilege Error. From the 10.6 AppleScript Release Notes - "For security reasons, most scripting addition commands now return a “privilege violation” error when sent between application processes."
Commands from scripting additions should either not be used in a Finder (or any other application) tell statement, or should be prefixed with "tell me" that you are not targeting the the application that's the target of the "tell" block, (e.g., the Finder, as in your script).
-- Michelle
--
"Experience is that marvelous thing that enables you to recognize a mistake when you make it again." --F. P. JONES