Okay, making some good progress here. I was able to download your code, create a new Applescript Droplet in xcode (first time with XCode), move your code into new project and modify "Application.applescript" to call "myapp" intead of "cat". This works:
Now, if I embed the source of myapp...