title: Cocoa API to set the default app for a file to open with
body: <p>Is there any Cocoa or Carbon API to set the default app to open with for a file?
  i.e If I select a file and do Cmd+i, we get an option 'Open With'. Here we can set the default app to open a file. Also, there is an option to apply this for all such files.</p>
  
  <p>How do I achieve both of these programmatically?</p>