title: Perform an action when application is started with 0 documents
body: <p>I have an NSDocument application that restores its windows when it is reopened. I would like to check the number of windows and perform an action (show a welcome window) if there are none.</p>
  
  <p>I tried to check <code>NSDocumentController.shared().documents.count</code> but it seems I check it at the wrong time because it is always 0 in the delegate lifecycle functions.</p>
  
  <p>How can I perform an action when the application is launched without restoring any windows?</p>