             }
         }
         
-        // reset tabbing setting
-        if isAutomaticTabbing {
-            // wait until finish
-            dispatchGroup.notify(queue: .main) {
+        // wait until finish
+        dispatchGroup.notify(queue: .main) {
+            // reset tabbing setting
+            if isAutomaticTabbing {
                 DocumentWindow.tabbingPreference = nil
             }
+            
+            NSApp.reply(toOpenOrPrint: reply)
         }
     }
     

//  ---------------------------------------------------------------------------
//
//  © 2004-2007 nakamuxu
//  © 2013-2020 1024jp
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.

                    NSApp.presentError(error)
                    
                    let cancelled = (error as? CocoaError)?.code == .userCancelled
                    reply = cancelled ? .cancel : .failure
                }
                
                // on first window opened
