     
     
     /// open multiple files at once
-    func application(_ sender: NSApplication, openFiles filenames: [String]) {
-        
-        let isAutomaticTabbing = (DocumentWindow.userTabbingPreference == .inFullScreen) && (filenames.count > 1)
+    func application(_ application: NSApplication, open urls: [URL]) {
+        
+        let isAutomaticTabbing = (DocumentWindow.userTabbingPreference == .inFullScreen) && (urls.count > 1)
         let dispatchGroup = DispatchGroup()
         var firstWindowOpened = false
         
-        for filename in filenames {
-            guard !self.application(sender, openFile: filename) else {
-                continue
+        for url in urls {
+            // try install if the file is CotEditor theme file
+            if DocumentType.theme.extensions.contains(url.pathExtension) {
+                guard !self.askInstallTheme(url: url) else { continue }
             }
-            
-            let url = URL(fileURLWithPath: filename)
             
             dispatchGroup.enter()
             DocumentController.shared.openDocument(withContentsOf: url, display: true) { (document, documentWasAlreadyOpen, error) in

    }
    
    
    /// open file
    func application(_ sender: NSApplication, openFile filename: String) -> Bool {
        
        let url = URL(fileURLWithPath: filename)
        
        // perform install if the file is CotEditor theme file
        guard DocumentType.theme.extensions.contains(url.pathExtension) else { return false }
        
        // ask whether theme file should be opened as a text file
        let alert = NSAlert()

        return true
    }
    
}
