It appears that on macOS 10.12 Sierra the .textClipping file is now a property list.
The root dictionary has the key "UTI-Data". In this case, the keys: com.apple.traditional-mac-plain-text, public.utf16-plain-text and public.utf8-plain-text contain several different representations of the data.
Here is an example that will read out of the way:
NSString *path = @"/path/to/file.textClipping"; NSData *data = [NSData dataWithContentsOfFile:path]; id plist = [NSPropertyListSerialization propertyListWithData:data options:0 format:nil error:&error]; NSString *text; if (plist && error == nil) { NSDictionary *utiData = [plist objectForKey:@"UTI-Data"]; text = [utiData objectForKey:@"public.utf8-plain-text"]; }
source share