         let fileManager = FileManager.default
         
         for path in openFiles {
-            
+
             do {
                 let files = try fileManager.contentsOfDirectory(atPath: path)
                 for file in files {

    
    // Called when the App opened via URL.
    @objc func handleURLEvent(_ event: NSAppleEventDescriptor, withReply reply: NSAppleEventDescriptor) {
        
        guard let keyDirectObject = event.paramDescriptor(forKeyword: AEKeyword(keyDirectObject)),
            let urlString = keyDirectObject.stringValue else {
                return print("No valid URL to handle")

        let index = urlString.index(urlString.startIndex, offsetBy: 9)
        let url = urlString.substring(from: index)

        NotificationCenter.default.post(name: Notification.Name(rawValue: "HeliumLoadURL"),
                                        object: url,
                                        userInfo: ["hwc" : hwc as Any])
    }

    @objc func handleURLPboard(_ pboard: NSPasteboard, userData: NSString, error: NSErrorPointer) {
        if let selection = pboard.string(forType: NSPasteboardTypeString) {
            let hwc = NSApp.keyWindow?.windowController

            // Notice: string will contain whole selection, not just the urls
            // So this may (and will) fail. It should instead find url in whole
            // Text somehow
            NotificationCenter.default.post(name: Notification.Name(rawValue: "HeliumLoadURL"),
                                            object: selection,
                                            userInfo: ["hwc" : hwc as Any])
        }
    }
    // MARK: Finder drops
    func application(_ sender: NSApplication, openFile: String) -> Bool {
        let urlString = (openFile.hasPrefix("file://") ? openFile : "file://" + openFile)
        return self.doOpenFile(fileURL: URL.init(string: urlString)!)
    }
    
    func application(_ sender: NSApplication, openFiles: [String]) {
