 
         if let urlPath = NSURL(string: script, relativeToURL: urlCwd) {
             if let path = urlPath.path {
-                let path = path.stringByDeletingLastPathComponent
+                let path = (path as NSString).stringByDeletingLastPathComponent
                 return path
             }
         }

    let script = Process.arguments[0];

    if script.hasPrefix("/") { // absolute
        let path = script.stringByDeletingLastPathComponent
        return path
    }
    else { // relative

            let swiftCharacter = Character(UnicodeScalar(self))

            let theCFMutableString = NSMutableString(string: String(swiftCharacter)) as CFMutableString
            CFStringTransform(theCFMutableString, UnsafeMutablePointer<CFRange>(), kCFStringTransformToUnicodeName, false)

            let characterName = theCFMutableString as String
            var trimmedName = characterName
