1

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!

Community
  • 1
  • 1
Shavkat
  • 83
  • 6

1 Answers1

2

You can use the osascript command on a AppleScript file or on an AppleScript saved as an Application

osascript test.app | less
jackjr300
  • 7,111
  • 2
  • 15
  • 25