     
     
     /// get keyboard shortcut from file name
-    private func shortcut(from fileURL: URL) -> Shortcut {
-        
-        let keySpecChars = fileURL.deletingPathExtension().pathExtension
+    private func shortcut(from url: URL) -> Shortcut {
+        
+        let keySpecChars = url.deletingPathExtension().pathExtension
         let shortcut = Shortcut(keySpecChars: keySpecChars)
         
         guard !shortcut.modifierMask.isEmpty else { return .none }

                item.tag = MainMenu.MenuItemTag.scriptDirectory.rawValue
                menu.addItem(item)
                item.submenu = submenu
                self.addChildFileItem(to: submenu, fromDirctory: fileURL)
                
            case URLFileResourceType.regular:
                guard (AppleScript.extensions + ShellScript.extensions).contains(fileURL.pathExtension) else { continue }
                
                let shortcut = self.shortcut(from: fileURL)
                let item = NSMenuItem(title: title, action: #selector(launchScript), keyEquivalent: shortcut.keyEquivalent)
                item.keyEquivalentModifierMask = shortcut.modifierMask
                item.representedObject = fileURL
                item.target = self
                item.toolTip = NSLocalizedString("“Option + click” to open script in editor.", comment: "")
                menu.addItem(item)

    // MARK: Private Methods
    
    /// read files and create/add menu items
    private func addChildFileItem(to menu: NSMenu, in directoryURL: URL) {
        
        guard let urls = try? FileManager.default.contentsOfDirectory(at: directoryURL,
                                                                      includingPropertiesForKeys: [.fileResourceTypeKey],
                                                                      options: [.skipsPackageDescendants, .skipsHiddenFiles])
            else { return }
        
        for url in urls {
            // ignore files/folders of which name starts with "_"
            if url.lastPathComponent.hasPrefix("_") { continue }
        
            let title = self.scriptName(from: url)
            
            if title == String.separator {
                menu.addItem(NSMenuItem.separator())
                continue
            }
            
            guard let resourceType = (try? url.resourceValues(forKeys: [.fileResourceTypeKey]))?.fileResourceType else { continue }
            
            switch resourceType {
            case URLFileResourceType.directory:
