 
 
 
+enum ScriptingFileType {
+    case appleScript
+    case shellScript
+    case unknown
+}
+
+
+
 class ScriptDescriptor {
     
     // MARK: Public Properties

    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
        }
    }
}
