MDItemCopyAttributeNames not returning kMDItemTextContent

Hi,

I am logging all the attributes of my file with the following code:


MDItemRef item = MDItemCreate(NULL, (__bridge CFStringRef)path);

CFArrayRef attributeNames = MDItemCopyAttributeNames(item);
NSDictionary* attributes = CFBridgingRelease(MDItemCopyAttributes(item, attributeNames));

for(NSDictionary *key in attributes) {
  NSLog(@"[%@] = %@", key, [attributes objectForKey:key]);
}

CFRelease(item);


When I do the same with mdimport -d3 "path" I get the same properties but kMDItemTextContent. I tried calling MDItemCopyAttribute directly with that property and it returns nil. How do I get this property programmatically?

Thanks,

Pierre

Accepted Reply

The docs are pretty clear about this:

Applications can search for values in this attribute, but are not able to read the content of this attribute directly.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

The docs are pretty clear about this:

Applications can search for values in this attribute, but are not able to read the content of this attribute directly.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"