         // Extract from URL
         
         self.url = url
+        
+        self.type = ScriptDescriptor.extensions.first { $0.value.contains(url.pathExtension) }?.key ?? .unknown
         
         var name = url.deletingPathExtension().lastPathComponent
         

    let ordering: Int?
    let shortcut: Shortcut
    let eventTypes: [ScriptingEventType]
    
    
    /// A Boolean value that indicates whether the receiver represents an AppleScript or a JXA script.
    var isAppleScript: Bool {
        get {
            return ["applescript", "scpt", "scptd"].contains(self.url.pathExtension)
        }
    }
    
    
    /// A Boolean value that indicates whether the receiver represents a shell script.
    var isShellScript: Bool {
        get {
            return ["sh", "pl", "php", "rb", "py", "js"].contains(self.url.pathExtension)
        }
    }
    
    
    

    /// - returns: An instance of `Script` created by the receiver.
    ///            Returns `nil` if the script type is unsupported.
    func makeScript() -> Script? {
        switch self.type {
        case .appleScript: return AppleScript(with: self)
        case .shellScript: return ShellScript(with: self)
        case .unknown: return nil
        }
    }
}
