Hello Matthias_dp,
That's one unusual error! Just to be sure: did you try to export this file also on another computer without the error happening? Does it happen on any document or just on this one?
The screenshot shows you have v4.9, the latest script is 5.1, you can get it by clicking on this link:
http://esotericsoftware.com/spine-scripts/PhotoshopToSpine.jsx
(you can also check for the latest version and instructions here: spine-scripts/photoshop at master · EsotericSoftware/spine-scripts )
Still, the script never calls any printing functions, so why this error appears is likely due to some preference setting or similar within Photoshop, perhaps it has something to do with your preferences for saving files?
In any case, you can check exactly when this is triggered by running the Adobe ExtendScript Toolkit, as explained below:
Run Adobe ExtendScript Toolkit that should have come with Photoshop (it's probably in your Start menu, if on Windows).
Open the PhotoshopToSpine.jsx file in that, choose Photoshop from the select box at the top, make sure your PSD is open in Photoshop, then press F5 to run the script as normal.
Uncheck the setting "Do not break on guarded exceptions" in case you have it active in the Debug menu.
Then run the script using the tool rather than running it in Photoshop. Eg, choose File -> Open, choose the PhotoshopToSpine script, then make sure Photoshop is running and choose Debug -> Run (or F5).
The script runs and execution will stop at any line where an error occurs.
Note some lines are expected to cause an error and those are surrounded by try { and } catch (ignored) {}. When execution stops at a line like that, choose Debug -> Run (or F5) again to continue execution.
The line it stops on just before showing the error dialog is likely the line we are interested in. If you can tell us what line number that is, we should be able to determine why the script isn't working for you. Please also include the text of that line, to be sure we are looking at the same file.