I'm writing an Apple Script and exporting it as an Application. I need this application to output data to standard output. I tried the approach in this answer and had no luck.
Here is a sample Apple Script:
return "Hello World!"
When I run this script using osascript I get a correct output:
$ osascript test.scpt
Hello World
But when I export the script as an Application and then do
$ test.app/Contents/MacOS/applet
I get no any output.
I need it to send a standard output that can be used in a pipe, e.g. like this:
$ test.app/Contents/MacOS/applet | less
Is there a way to achieve this behavior?
Thanks!