title: How to include and call an executable in a Cocoa app?
body: <p>I can run an executable from a known local directory within a Cocoa app like this:</p>
  
  <pre><code>// Run the server.
  
  NSTask *task = [[NSTask alloc] init];
  NSPipe *pipe = [NSPipe pipe];
  NSString* scriptPath = @"/Users/example/Server/runServerExecutable.sh";
  [task setLaunchPath: @"/bin/sh"];
  [task setArguments: [NSArray arrayWithObjects: scriptPath, nil]];
  [task setStandardOutput: pipe];
  [task launch];
  </code></pre>
  
  <p>Could anyone help me on these questions? </p>
  
  <ul>
  <li>Where should I include the executable/script/text files in the app bundle?</li>
  <li>How to modify <code>scriptPath</code> to run the script programmatically?</li>
  </ul>
  
  <p>Thanks a lot!</p>