Dispatch - Simple Automatic Check-in

I want users to be able to add files to the vault with dispatch automatically checking in/out the files so they are publicly visible and available. I wrote a really simple dispatch script but it is throwing errors. Does anyone have any ideas? See attached for errors. If the files were properly handled, they would have a workflow state.

SolidworksSolidworks Pdm enterprise Pdm