title: What's the accepted way to implement export functionality in a document-based Cocoa app?
body: <p>I have a simple document-based Cocoa app that acts as a viewer for .wav files, to do a bit of frequency analysis. I'd like to be able to export the data gleaned from opened files to CSVs for further analysis in other programs.</p>
  
  <p>The document-based application framework in Cocoa lets you override</p>
  
  <pre><code>- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
  </code></pre>
  
  <p>to implement the default Save/Save As... workflow, but I don't want to write the files that I open.</p>
  
  <p>The obvious thing to do is implement an export workflow in my document, to present a file save sheet, build some NSData, and write it to a file path, but there is not an obvious way to connect an outlet in the MainMenu nib to an action on a document controller.</p>
  
  <p>So, then, what is the accepted way to implement such functionality in a document-based Cocoa app?</p>