Metadata Schema Reference

Framework
CoreServices/CoreServices.h
Companion guide
Declared in
MDSchema.h

Overview

The MDSchema functions provide information about the metadata returned for an item including the type of metadata provided for a file type, the localized display name for a metadata attribute key, and the schema for a metadata attribute key.

Functions

MDSchemaCopyAllAttributes

Returns an array containing all the metadata attributes defined in the schema.

CFArrayRef MDSchemaCopyAllAttributes (
   void
);
Availability
  • Available in OS X version 10.4 or later.
Declared In
MDSchema.h

MDSchemaCopyAttributesForContentType

Returns a dictionary containing the metadata attributes for the specified UTI type.

MD_BEGIN_C_DECLS CFDictionaryRef MDSchemaCopyAttributesForContentType (
   CFStringRef contentTypeUTI
);
Parameters
utiType

The UTI type.

Return Value

A dictionary containing kMDAttributeDisplayValues and kMDAttributeAllValues keys. Returns NULL if the UTI type is unknown.

Discussion

This function returns the metadata attributes for the specified UTI type only.

Availability
  • Available in OS X version 10.4 or later.
Declared In
MDSchema.h

MDSchemaCopyDisplayDescriptionForAttribute

Returns the localized description of a metadata attribute key.

CFStringRef MDSchemaCopyDisplayDescriptionForAttribute (
   CFStringRef name
);
Parameters
name

The name of the metadata attribute key.

Return Value

The localized description of the metadata attribute, or NULL if no localized description is available.

Availability
  • Available in OS X version 10.4 or later.
Declared In
MDSchema.h

MDSchemaCopyDisplayNameForAttribute

Returns the localized display name of a metadata attribute key.

CFStringRef MDSchemaCopyDisplayNameForAttribute (
   CFStringRef name
);
Parameters
name

The name of the metadata attribute key.

Return Value

The localized display name of the metadata attribute, or NULL if no localized display name is available.

Availability
  • Available in OS X version 10.4 or later.
Declared In
MDSchema.h

MDSchemaCopyMetaAttributesForAttribute

Returns a dictionary describing the values for the specified metadata attribute key.

CFDictionaryRef MDSchemaCopyMetaAttributesForAttribute (
   CFStringRef name
);
Parameters
name

The name of the metadata attribute key.

Return Value

A dictionary describing the schema of the metadata attribute key.

Availability
  • Available in OS X version 10.4 or later.
Declared In
MDSchema.h

Constants

Available Metadata Attribute Keys

Specify the available metadata attribute keys for a content type.

const CFStringRef kMDAttributeDisplayValues;
const CFStringRef kMDAttributeAllValues;
const CFStringRef kMDAttributeReadOnlyValues;
const CFStringRef kMDExporterAvaliable;
Constants
kMDAttributeDisplayValues

An array of strings containing the available display metadata attribute keys, or NULL if the type is not known by the system.

Available in OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeAllValues

An array of strings containing the available metadata attribute keys, or NULL if the type is not known by the system.

Available in OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeReadOnlyValues

An array of strings containing the read-only metadata attribute keys, or NULL if the type is not known by the system.

Available in OS X v10.5 and later.

Declared in MDSchema.h.

kMDExporterAvaliable

A CFBoolean that indicates if an exporter is available for this UTI type.

Available in OS X v10.5 and later.

Declared in MDSchema.h.

Discussion

These keys are in the dictionary returned by the function MDSchemaCopyAttributesForContentType.

Metadata Attribute Schema Description Keys

Specify the schema of a metadata attribute key.

const CFStringRef kMDAttributeName;
const CFStringRef kMDAttributeType;
const CFStringRef kMDAttributeMultiValued;
Constants
kMDAttributeName

A string containing the name of the metadata attribute key.

Available in OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeType

A CFNumberRef or CFTypeId describing the type of data returned as the value of the metadata attribute key.

Available in OS X v10.4 and later.

Declared in MDSchema.h.

kMDAttributeMultiValued

A boolean that indicates if the metadata attribute value is multi-valued. If this is TRUE, the metadata attribute value is an array of the types specified in kMDAttributeType.

Available in OS X v10.4 and later.

Declared in MDSchema.h.

Discussion

These keys are in the dictionary returned by the function MDSchemaCopyMetaAttributesForAttribute.