Improved support for passing events between scripts and Present3D application