0

I have made a shell script file and I want to be able to run it from within the application. Obviously, if I wanted to distribute the app, I would need to package the .sh file (which I have done) but I am not sure how to run the packaged .sh file. Does anyone know how to do this? Thanks

CloudSync
  • 45
  • 12
  • Look at [NSTask](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB8QFjAA&url=https%3A%2F%2Fdeveloper.apple.com%2Flibrary%2Fmac%2Fdocumentation%2FCocoa%2FReference%2FFoundation%2FClasses%2FNSTask_Class%2FReference%2FReference.html&ei=2AgWVPu9DonkaM3ngPgO&usg=AFQjCNExYvCAo4XewShPDs8SBK39W0qKXg&sig2=jO7_2SYYqY8CHqSDYEqL-A&bvm=bv.75097201,d.d2s) – mmmmmm Sep 14 '14 at 21:30
  • possible duplicate of [Execute a terminal command from a Cocoa app](http://stackoverflow.com/questions/412562/execute-a-terminal-command-from-a-cocoa-app) – mmmmmm Sep 14 '14 at 21:32

1 Answers1

0

This isn't the right answer, because it contains only an suggestion and not the solution, but the following could really help you:

Check the platypus application.

It creates native Mac OS X applications from interpreted scripts such as shell scripts or Perl, Ruby and Python programs. - e.g. create an wrapper where inside is the shell script, so you can check how it is done.

Moreover it is opensource, so you can check the source, how to do this correctly and for more insights.

clt60
  • 62,119
  • 17
  • 107
  • 194