Skip to content

Instantly share code, notes, and snippets.

@berkcebi
Created November 18, 2015 06:51
Show Gist options
  • Save berkcebi/e6f31b2b5d140da17bea to your computer and use it in GitHub Desktop.
Save berkcebi/e6f31b2b5d140da17bea to your computer and use it in GitHub Desktop.
save-document-with-delegate
@import 'MochaJSDelegate.js'
COScript.currentCOScript().setShouldKeepAround_(true);
var delegate = new MochaJSDelegate({
"document:didSave:contextInfo:": (function(document, didSave, contextInfo) {
[NSApp displayDialog:"Done!" withTitle:"Awesome!"];
COScript.currentCOScript().setShouldKeepAround_(false);
})
});
[doc saveDocumentWithDelegate:delegate.getClassInstance() didSaveSelector:NSSelectorFromString(@"document:didSave:contextInfo:") contextInfo:nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment