I am getting an error when trying to set a tag color Blue to a file using setResourceValue:
var error: NSError?
let listofTags = NSWorkspace.sharedWorkspace().fileLabels
let theURL:NSURL = NSURL.fileURLWithPath("/Volumes/234567_fr.tif")!
var Tag: AnyObject = NSWorkspace.sharedWorkspace().fileLabels[4] // Tag = "Blue"
theURL.setResourceValue(Tag, forKey: NSURLTagNamesKey, error: &error)
println(error) // Error Domain=NSOSStatusErrorDomain Code=-8050 "The operation couldn’t be completed. (OSStatus error -8050.)
Any idea? Thank you for your help