     var inputFilenames = Process.arguments
     inputFilenames.removeAtIndex(0)
     
-    var filePathsArr = Array<String>()
+    var filePathsArr = Array<NSURL>()
     
     for filename in inputFilenames
     {
-        if filename[0] == "/" {
-            filePathsArr.append(filename)
+        if filename.characters[filename.startIndex.advancedBy(0)]  == "/" {
+            filePathsArr.append(NSURL.fileURLWithPath(filename))
             continue
         }
         
-        if filename[0] == "~" {
-            filePathsArr.append(filename.stringByExpandingTildeInPath)
+        if filename.characters[filename.startIndex.advancedBy(0)]  == "~" {
+            filePathsArr.append(NSURL.fileURLWithPath(filename))
             continue
         }
         

        let fileUrl = NSURL(string: filename, relativeToURL: NSURL(fileURLWithPath: currentPath))
        if let u = fileUrl {
            if let p = u.path {
                filePathsArr.append(p)
            }
        }
    }

    
    for iconPath in filePaths
    {
        print("Processing file: \(iconPath)")
        
        let outputDir = outputDirPathForIconPath(iconPath)
        
        if !NSFileManager.defaultManager().fileExistsAtPath(outputDir.absoluteString) {
            
            do {
                try NSFileManager.defaultManager().createDirectoryAtPath(outputDir.path!, withIntermediateDirectories: false, attributes: [:])
            } catch {
                print("Error creating image folder")
            }
        }
        
        
        for resolution in iconResolutions
        {
            let targetIconPath = outputDir.URLByAppendingPathComponent("icon-\(resolution).png")
            do {
                try NSFileManager.defaultManager().copyItemAtPath(iconPath.path!, toPath: targetIconPath.path!)
            } catch {
                print("Error copying images")
            }
            
            
            scaleIcon(targetIconPath, resolution: resolution)
        }
    }
}

// =======
