You simply cannot do this with Perspective. It is security violation for a browser to launch any real application on the client machine.
On top of that, all scripts in Perspective run on the gateway, not in the browser. So your script is trying to open notepad.exein the gateway, in the background service where there's No UI at all.
If you absolutely have to be able to do this sort of thing, you need to use Vision, not Perspective.
You could install an uri, but that means you have to install it on every clients pc (that needs this feature)
i have an example that can opens files (on windows)