Mac Developer Library

Developer

CoreServices Framework Reference MDItem Reference

Options
Deployment Target:

On This Page
Language:

MDItem Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreServices

Objective-C

@import CoreServices;

MDItem is a CF-compliant object that represents a file and the metadata associated with the file.

For functions that expect an MDItemRef parameter, if this parameter is not a valid MDItemRef, the behavior is undefined. NULL is not a valid MDItemRef.

Functions

  • Creates an MDItem object for a file at the specified path.

    Declaration

    Swift

    func MDItemCreate(_ allocator: CFAllocator!, _ path: CFString!) -> MDItem!

    Objective-C

    MDItemRef MDItemCreate ( CFAllocatorRef allocator, CFStringRef path );

    Parameters

    allocator

    The CFAllocator object to be used to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    path

    A path to the file from which to create the MDItem. The path must exist.

    Return Value

    An MDItem object or NULL if there was a problem creating the object.

    Discussion

    Returns a metadata item for the given URL.

    Special Considerations

    In OS X v 10.5 and later MDItemRefs may or may not be uniqued. You should always use CFEqual for comparison.

    Prior to OS X v 10.5 items were guaranteed to be unique and == could or CFEqual could be used for the comparison.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 and later.

  • Creates an MDItem object for a file at the specified file URL.

    Declaration

    Swift

    func MDItemCreateWithURL(_ allocator: CFAllocator!, _ url: CFURL!) -> MDItem!

    Objective-C

    MDItemRef MDItemCreateWithURL ( CFAllocatorRef allocator, CFURLRef url );

    Parameters

    allocator

    The CFAllocator object to be used to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

    url

    A file URL to the file from which to create the MDItem. The file must exist.

    Return Value

    An MDItem object or NULL if there was a problem creating the object.

    Discussion

    Returns a metadata item for the given URL.

    Special Considerations

    In OS X v 10.5 and later MDItemRefs may or may not be uniqued. You should always use CFEqual for comparison.

    Prior to OS X v 10.5 items were guaranteed to be unique and == could or CFEqual could be used for the comparison.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.6 and later.

  • Returns the type identifier of all MDItem instances.

    Declaration

    Swift

    func MDItemGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID MDItemGetTypeID ( void );

    Return Value

    The type identifier for the MDItem opaque type.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 and later.

  • Returns the value of the specified attribute in the metadata item.

    Declaration

    Swift

    func MDItemCopyAttribute(_ item: MDItem!, _ name: CFString!) -> AnyObject!

    Objective-C

    CFTypeRef MDItemCopyAttribute ( MDItemRef item, CFStringRef name );

    Parameters

    item

    The item to be queried.

    name

    The name of the requested attribute.

    Return Value

    A CFTypeRef, or NULL if there was a failure reading the attribute or the attribute does not exist.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 and later.

  • Returns the values of the specified attributes in the metadata item.

    Declaration

    Swift

    func MDItemCopyAttributes(_ item: MDItem!, _ names: CFArray!) -> CFDictionary!

    Objective-C

    CFDictionaryRef MDItemCopyAttributes ( MDItemRef item, CFArrayRef names );

    Parameters

    item

    The item to be queried.

    names

    A CFArray containing the names of the requested attributes.

    Return Value

    A CFDictionary containing keys for the requested attribute names, and the corresponding values. If an attribute does not exist, or the attribute is unreadable, there will be no key-value pair for it in the dictionary. Returns NULL on failure.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 and later.

  • Returns the values of the specified attributes in the metadata item.

    Declaration

    Objective-C

    CFDictionaryRef MDItemCopyAttributeList ( MDItemRef item, ... );

    Parameters

    item

    The item to be queried.

    ...

    A comma-separated varargs list of the string attribute names..

    Return Value

    A CFDictionary containing keys for the requested attribute names, and the corresponding values. If an attribute does not exist, or the attribute is unreadable, there will be no key-value pair for it in the dictionary. Returns NULL on failure.

    Import Statement

    Objective-C

    @import CoreServices;

    Availability

    Available in OS X version 10.4 and later.

  • Returns an array containing the attribute names existing in the metadata item.

    Declaration

    Swift

    func MDItemCopyAttributeNames(_ item: MDItem!) -> CFArray!

    Objective-C

    CFArrayRef MDItemCopyAttributeNames ( MDItemRef item );

    Parameters

    item

    The item to be queried.

    Return Value

    A CFArray of CFString attribute names, or NULL on failure.

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X version 10.4 and later.

Data Types

Miscellaneous

  • A reference to a MDItem object.

    Declaration

    Swift

    typealias MDItemRef = MDItem

    Objective-C

    typedef struct __MDItem *MDItemRef;

    Import Statement

    Objective-C

    @import CoreServices;

    Swift

    import CoreServices

    Availability

    Available in OS X v10.4 and later.

Constants

  • Metadata attribute keys that are common to many file types.

    Declaration

    Swift

    let kMDItemAttributeChangeDate: CFString! let kMDItemAudiences: CFString! let kMDItemAuthors: CFString! let kMDItemAuthorAddresses: CFString! let kMDItemCity: CFString! let kMDItemComment: CFString! let kMDItemContactKeywords: CFString! let kMDItemContentCreationDate: CFString! let kMDItemContentModificationDate: CFString! let kMDItemContentType: CFString! let kMDItemContributors: CFString! let kMDItemCopyright: CFString! let kMDItemCountry: CFString! let kMDItemCoverage: CFString! let kMDItemCreator: CFString! let kMDItemDescription: CFString! let kMDItemDueDate: CFString! let kMDItemDurationSeconds: CFString! let kMDItemEmailAddresses: CFString! let kMDItemEncodingApplications: CFString! let kMDItemFinderComment: CFString! let kMDItemFonts: CFString! let kMDItemHeadline: CFString! let kMDItemIdentifier: CFString! let kMDItemInstantMessageAddresses: CFString! let kMDItemInstructions: CFString! let kMDItemKeywords: CFString! let kMDItemKind: CFString! let kMDItemLanguages: CFString! let kMDItemLastUsedDate: CFString! let kMDItemNumberOfPages: CFString! let kMDItemOrganizations: CFString! let kMDItemPageHeight: CFString! let kMDItemPageWidth: CFString! let kMDItemParticipants: CFString! let kMDItemPhoneNumbers: CFString! let kMDItemProjects: CFString! let kMDItemPublishers: CFString! let kMDItemRecipients: CFString! let kMDItemRecipientAddresses: CFString! let kMDItemRights: CFString! let kMDItemSecurityMethod: CFString! let kMDItemStarRating: CFString! let kMDItemStateOrProvince: CFString! let kMDItemTextContent: CFString! let kMDItemTitle: CFString! let kMDItemVersion: CFString! let kMDItemWhereFroms: CFString! let kMDItemAuthorEmailAddresses: CFString! let kMDItemRecipientEmailAddresses: CFString! let kMDItemTheme: CFString! let kMDItemSubject: CFString! let kMDItemCFBundleIdentifier: CFString! let kMDItemFSHasCustomIcon: CFString! let kMDItemFSIsStationery: CFString! let kMDItemInformation: CFString! let kMDItemURL: CFString!

    Objective-C

    const CFStringRef kMDItemAttributeChangeDate; const CFStringRef kMDItemAudiences; const CFStringRef kMDItemAuthors; const CFStringRef kMDItemAuthorAddresses; const CFStringRef kMDItemCity; const CFStringRef kMDItemComment; const CFStringRef kMDItemContactKeywords; const CFStringRef kMDItemContentCreationDate; const CFStringRef kMDItemContentModificationDate; const CFStringRef kMDItemContentType; const CFStringRef kMDItemContributors; const CFStringRef kMDItemCopyright; const CFStringRef kMDItemCountry; const CFStringRef kMDItemCoverage; const CFStringRef kMDItemCreator; const CFStringRef kMDItemDescription; const CFStringRef kMDItemDueDate; const CFStringRef kMDItemDurationSeconds; const CFStringRef kMDItemEmailAddresses; const CFStringRef kMDItemEncodingApplications; const CFStringRef kMDItemFinderComment; const CFStringRef kMDItemFonts; const CFStringRef kMDItemHeadline; const CFStringRef kMDItemIdentifier; const CFStringRef kMDItemInstantMessageAddresses; const CFStringRef kMDItemInstructions; const CFStringRef kMDItemKeywords; const CFStringRef kMDItemKind; const CFStringRef kMDItemLanguages; const CFStringRef kMDItemLastUsedDate; const CFStringRef kMDItemNumberOfPages; const CFStringRef kMDItemOrganizations; const CFStringRef kMDItemPageHeight; const CFStringRef kMDItemPageWidth; const CFStringRef kMDItemParticipants; const CFStringRef kMDItemPhoneNumbers; const CFStringRef kMDItemProjects; const CFStringRef kMDItemPublishers; const CFStringRef kMDItemRecipients; const CFStringRef kMDItemRecipientAddresses; const CFStringRef kMDItemRights; const CFStringRef kMDItemSecurityMethod; const CFStringRef kMDItemStarRating; const CFStringRef kMDItemStateOrProvince; const CFStringRef kMDItemTextContent; const CFStringRef kMDItemTitle; const CFStringRef kMDItemVersion; const CFStringRef kMDItemWhereFroms; const CFStringRef kMDItemSupportFileType; const CFStringRef kMDItemAuthorEmailAddresses; const CFStringRef kMDItemRecipientEmailAddresses; const CFStringRef kMDItemTheme; const CFStringRef kMDItemSubject; const CFStringRef kMDItemCFBundleIdentifier; const CFStringRef kMDItemFSHasCustomIcon; const CFStringRef kMDItemFSIsStationery; const CFStringRef kMDItemInformation; const CFStringRef kMDItemURL;

    Constants

    • kMDItemAttributeChangeDate

      kMDItemAttributeChangeDate

      The date and time of the last change made to a metadata attribute. A CFDate.

      Available in OS X v10.4 and later.

    • kMDItemAudiences

      kMDItemAudiences

      The audience for which the file is intended. The audience may be determined by the creator or the publisher or by a third party. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemAuthors

      kMDItemAuthors

      The author, or authors, of the contents of the file. A CFArray of CFStrings.

      The order of the authors is preserved, but does not represent the main author or relative importance of the authors.

      Available in OS X v10.4 and later.

    • kMDItemAuthorAddresses

      kMDItemAuthorAddresses

      This attribute indicates the author addresses of the document. A CFArray of CFStrings.

      Available in OS X v10.6 and later.

    • kMDItemCity

      kMDItemCity

      Identifies city of origin according to guidelines established by the provider. A CFString.

      For example, "New York", "Cupertino", or "Toronto".

      Available in OS X v10.4 and later.

    • kMDItemComment

      kMDItemComment

      A comment related to the file. This differs from the Finder comment, kMDItemFinderComment. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemContactKeywords

      kMDItemContactKeywords

      A list of contacts that are associated with this document, not including the authors. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemContentCreationDate

      kMDItemContentCreationDate

      The date that the contents of the file were created. A CFDate.

      This is different than the file creation date. Its can be used to store when the file contents were first created, or first modified.

      Available in OS X v10.4 and later.

    • kMDItemContentModificationDate

      kMDItemContentModificationDate

      The date and time that the contents of the file were last modified. A CFDate.

      This is not necessarily the file modification date.

      Available in OS X v10.4 and later.

    • kMDItemContentType

      kMDItemContentType

      The UTI pedigree of a file. A CFString.

      For example, a jpeg image file will have a value of public.jpeg/public.image/public.data. The value of this attribute is set by the MDImporter. Changes to this value are lost when the file attributes are next imported.

      Available in OS X v10.4 and later.

    • kMDItemContributors

      kMDItemContributors

      The entities responsible for making contributions to the content of the resource. A CFArray of CFStrings.

      Examples of a contributor include a person, an organization or a service.

      Available in OS X v10.4 and later.

    • kMDItemCopyright

      kMDItemCopyright

      The copyright owner of the file contents. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemCountry

      kMDItemCountry

      The full, publishable name of the country or primary location where the intellectual property of the item was created, according to guidelines of the provider. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemCoverage

      kMDItemCoverage

      The extent or scope of the content of the resource. A CFString.

      Coverage will typically include spatial location (a place name or geographic co-ordinates), temporal period (a period label, date, or date range) or jurisdiction (such as a named administrative entity).

      Recommended best practice is to select a value from a controlled vocabulary, and that, where appropriate, named places or time periods be used in preference to numeric identifiers such as sets of co-ordinates or date ranges.

      Available in OS X v10.4 and later.

    • kMDItemCreator

      kMDItemCreator

      Application used to create the document content (e.g. "Word", "AppleWorks", etc.). A CFString.

      Available in OS X v10.4 and later.

    • kMDItemDescription

      kMDItemDescription

      A description of the content of the resource. The description may include an abstract, table of contents, reference to a graphical representation of content or a free-text account of the content. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemDueDate

      kMDItemDueDate

      Date this item is due. A CFDate.

      Available in OS X v10.4 and later.

    • kMDItemDurationSeconds

      kMDItemDurationSeconds

      The duration, in seconds, of the content of file. A value of 10.5 represents media that is 10 and 1/2 seconds long. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemEmailAddresses

      kMDItemEmailAddresses

      Email addresses related to this item. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemEncodingApplications

      kMDItemEncodingApplications

      Application used to convert the original content into it's current form. For example, a PDF file might have an encoding application set to "Distiller". A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemFinderComment

      kMDItemFinderComment

      Finder comments for this file. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemFonts

      kMDItemFonts

      Fonts used in this item. You should store the font's full name, the postscript name, or the font family name, based on the available information. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemHeadline

      kMDItemHeadline

      A publishable entry providing a synopsis of the contents of the file. For example, "Apple Introduces the iPod Photo". A CFString.

      Available in OS X v10.4 and later.

    • kMDItemIdentifier

      kMDItemIdentifier

      A formal identifier used to reference the resource within a given context. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemInstantMessageAddresses

      kMDItemInstantMessageAddresses

      Instant message addresses related to this item. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemInstructions

      kMDItemInstructions

      Editorial instructions concerning the use of the item, such as embargoes and warnings. For example, "Second of four stories". A CFString.

      Available in OS X v10.4 and later.

    • kMDItemKeywords

      kMDItemKeywords

      Keywords associated with this file. For example, “Birthday”, “Important”, etc. An CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemKind

      kMDItemKind

      A description of the kind of item this file represents. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemLanguages

      kMDItemLanguages

      Indicates the languages of the intellectual content of the resource. Recommended best practice for the values of the Language element is defined by RFC 3066. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemLastUsedDate

      kMDItemLastUsedDate

      The date and time that the file was last used. This value is updated automatically by LaunchServices everytime a file is opened by double clicking, or by asking LaunchServices to open a file. A CFDate.

      Available in OS X v10.4 and later.

    • kMDItemNumberOfPages

      kMDItemNumberOfPages

      Number of pages in the document. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemOrganizations

      kMDItemOrganizations

      The company or organization that created the document. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemPageHeight

      kMDItemPageHeight

      Height of the document page, in points (72 points per inch). For PDF files this indicates the height of the first page only. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemPageWidth

      kMDItemPageWidth

      Width of the document page, in points (72 points per inch). For PDF files this indicates the width of the first page only. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemParticipants

      kMDItemParticipants

      The list of people who are visible in an image or movie or written about in a document. A CFArray of CFStrings.

      Available in OS X v10.6 and later.

    • kMDItemPhoneNumbers

      kMDItemPhoneNumbers

      Phone numbers related to this item. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemProjects

      kMDItemProjects

      The list of projects that this file is part of. For example, if you were working on a movie all of the files could be marked as belonging to the project “My Movie”. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemPublishers

      kMDItemPublishers

      The entity responsible for making the resource available. For example, a person, an organization, or a service. Typically, the name of a publisher should be used to indicate the entity. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemRecipients

      kMDItemRecipients

      Recipients of this item. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemRecipientAddresses

      kMDItemRecipientAddresses

      This attribute indicates the recipient addresses of the document. A CFArray of CFStrings.

      Available in OS X v10.6 and later.

    • kMDItemRights

      kMDItemRights

      Provides a link to information about rights held in and over the resource. A CFString.

      Contains a rights management statement for the resource, or reference a service providing such information. Rights information often encompasses Intellectual Property Rights (IPR), Copyright, and various Property Rights.

      If this attribute is absent, no assumptions can be made about the status of these and other rights with respect to the resource.

      Available in OS X v10.4 and later.

    • kMDItemSecurityMethod

      kMDItemSecurityMethod

      The security or encryption method used for the file. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemStarRating

      kMDItemStarRating

      User rating of this item. For example, the stars rating of an iTunes track. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemStateOrProvince

      kMDItemStateOrProvince

      Identifies the province or state of origin according to guidelines established by the provider. For example, "CA", "Ontario", or "Sussex". A CFString.

      Available in OS X v10.4 and later.

    • kMDItemTextContent

      kMDItemTextContent

      Contains a text representation of the content of the document. Data in multiple fields should be combined using a whitespace character as a separator. A CFString.

      An application's Spotlight importer provides the content of this attribute. Applications can search for values in this attribute, but are not able to read the content of this attribute directly.

      Available in OS X v10.4 and later.

    • kMDItemTitle

      kMDItemTitle

      The title of the file. For example, this could be the title of a document, the name of an song, or the subject of an email message. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemVersion

      kMDItemVersion

      The version number of this file. A CFString

      Available in OS X v10.4 and later.

    • kMDItemWhereFroms

      kMDItemWhereFroms

      Describes where the file was obtained from. A CFArray of CFStrings.

      For example, a downloaded file may refer to the URL, files received by email may indicate the sender’s email address, message subject, etc.

      Available in OS X v10.4 and later.

    • kMDItemSupportFileType

      kMDItemSupportFileType

      A CFArray of CFStrings.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.5.

    • kMDItemAuthorEmailAddresses

      kMDItemAuthorEmailAddresses

      This attribute indicates the author of the emails message addresses. (This is always the email address, and not the human readable version). A CFArray of CFStrings.

      Available in OS X v10.5 and later.

    • kMDItemRecipientEmailAddresses

      kMDItemRecipientEmailAddresses

      This attribute indicates the recipients email addresses. (This is always the email address, and not the human readable version). A CFArray of CFStrings.

      Available in OS X v10.5 and later.

    • kMDItemTheme

      kMDItemTheme

      Theme of the this item. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemSubject

      kMDItemSubject

      Subject of the this item. Type is a CFString.

      Available in OS X v10.4 and later.

    • kMDItemCFBundleIdentifier

      kMDItemCFBundleIdentifier

      If this item is a bundle, then this is the CFBundleIdentifier. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemFSHasCustomIcon

      kMDItemFSHasCustomIcon

      Boolean indicating if this file has a custom icon. Type is a CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemFSIsStationery

      kMDItemFSIsStationery

      Boolean indicating if this file is stationery. Type is a CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemInformation

      kMDItemInformation

      Information about the item. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemURL

      kMDItemURL

      Url of the item. A CFString.

      Available in OS X v10.5 and later.

  • Metadata attribute keys that are common to image files.

    Declaration

    Swift

    let kMDItemPixelHeight: CFString! let kMDItemPixelWidth: CFString! let kMDItemPixelCount: CFString! let kMDItemColorSpace: CFString! let kMDItemBitsPerSample: CFString! let kMDItemFlashOnOff: CFString! let kMDItemFocalLength: CFString! let kMDItemAcquisitionMake: CFString! let kMDItemAcquisitionModel: CFString! let kMDItemISOSpeed: CFString! let kMDItemOrientation: CFString! let kMDItemLayerNames: CFString! let kMDItemWhiteBalance: CFString! let kMDItemAperture: CFString! let kMDItemProfileName: CFString! let kMDItemResolutionWidthDPI: CFString! let kMDItemResolutionHeightDPI: CFString! let kMDItemExposureMode: CFString! let kMDItemExposureTimeSeconds: CFString! let kMDItemEXIFVersion: CFString! let kMDItemAlbum: CFString! let kMDItemHasAlphaChannel: CFString! let kMDItemRedEyeOnOff: CFString! let kMDItemMeteringMode: CFString! let kMDItemMaxAperture: CFString! let kMDItemFNumber: CFString! let kMDItemExposureProgram: CFString! let kMDItemExposureTimeString: CFString! let kMDItemEXIFGPSVersion: CFString! let kMDItemAltitude: CFString! let kMDItemLatitude: CFString! let kMDItemLongitude: CFString! let kMDItemTimestamp: CFString! let kMDItemSpeed: CFString! let kMDItemGPSTrack: CFString! let kMDItemImageDirection: CFString! let kMDItemNamedLocation: CFString!

    Objective-C

    const CFStringRef kMDItemPixelHeight; const CFStringRef kMDItemPixelWidth; const CFStringRef kMDItemPixelCount; const CFStringRef kMDItemColorSpace; const CFStringRef kMDItemBitsPerSample; const CFStringRef kMDItemFlashOnOff; const CFStringRef kMDItemFocalLength; const CFStringRef kMDItemAcquisitionMake; const CFStringRef kMDItemAcquisitionModel; const CFStringRef kMDItemISOSpeed; const CFStringRef kMDItemOrientation; const CFStringRef kMDItemLayerNames; const CFStringRef kMDItemWhiteBalance; const CFStringRef kMDItemAperture; const CFStringRef kMDItemProfileName; const CFStringRef kMDItemResolutionWidthDPI; const CFStringRef kMDItemResolutionHeightDPI; const CFStringRef kMDItemExposureMode; const CFStringRef kMDItemExposureTimeSeconds; const CFStringRef kMDItemEXIFVersion; const CFStringRef kMDItemAlbum; const CFStringRef kMDItemHasAlphaChannel; const CFStringRef kMDItemRedEyeOnOff; const CFStringRef kMDItemMeteringMode; const CFStringRef kMDItemMaxAperture; const CFStringRef kMDItemFNumber; const CFStringRef kMDItemExposureProgram; const CFStringRef kMDItemExposureTimeString; const CFStringRef kMDItemEXIFGPSVersion; const CFStringRef kMDItemAltitude; const CFStringRef kMDItemLatitude; const CFStringRef kMDItemLongitude; const CFStringRef kMDItemTimestamp; const CFStringRef kMDItemSpeed; const CFStringRef kMDItemGPSTrack; const CFStringRef kMDItemImageDirection; const CFStringRef kMDItemNamedLocation;

    Constants

    • kMDItemPixelHeight

      kMDItemPixelHeight

      The height, in pixels, of the contents. For example, the image height or the video frame height. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemPixelWidth

      kMDItemPixelWidth

      The width, in pixels, of the contents. For example, the image width or the video frame width. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemPixelCount

      kMDItemPixelCount

      The total number of pixels in the contents. Same as kMDItemPixelWidth x kMDItemPixelHeight. A CFNumber.

      Available in OS X v10.6 and later.

    • kMDItemColorSpace

      kMDItemColorSpace

      The color space model used by the document contents. For example, “RGB”, “CMYK”, “YUV”, or “YCbCr”. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemBitsPerSample

      kMDItemBitsPerSample

      The number of bits per sample. For example, the bit depth of an image (8-bit, 16-bit etc...) or the bit depth per audio sample of uncompressed audio data (8, 16, 24, 32, 64, etc..). A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFlashOnOff

      kMDItemFlashOnOff

      Indicates if a camera flash was used. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFocalLength

      kMDItemFocalLength

      The actual focal length of the lens, in millimeters. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemAcquisitionMake

      kMDItemAcquisitionMake

      The manufacturer of the device used to aquire the document contents. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemAcquisitionModel

      kMDItemAcquisitionModel

      The model of the device used to aquire the document contents. For example, 100, 200, 400, etc. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemISOSpeed

      kMDItemISOSpeed

      The ISO speed used to acquire the document contents. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemOrientation

      kMDItemOrientation

      The orientation of the document contents. Possible values are 0 (landscape) and 1 (portrait). A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemLayerNames

      kMDItemLayerNames

      The names of the layers in the file. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemWhiteBalance

      kMDItemWhiteBalance

      The white balance setting used to acquire the document contents. Possible values are 0 (auto white balance) and 1 (manual). A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemAperture

      kMDItemAperture

      The aperture setting used to acquire the document contents. This unit is the APEX value. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemProfileName

      kMDItemProfileName

      The name of the color profile used by the document contents. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemResolutionWidthDPI

      kMDItemResolutionWidthDPI

      Resolution width, in DPI, of this image. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemResolutionHeightDPI

      kMDItemResolutionHeightDPI

      Resolution height, in DPI, of this image. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemExposureMode

      kMDItemExposureMode

      The exposure mode used to acquire the document contents. A CFNumber.

      Possible values are 0 (auto exposure), 1 (manual exposure) and 2 (auto bracket).

      Available in OS X v10.4 and later.

    • kMDItemExposureTimeSeconds

      kMDItemExposureTimeSeconds

      The exposure time, in seconds, used to acquire the document contents. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemEXIFVersion

      kMDItemEXIFVersion

      The version of the EXIF header used to generate the metadata. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemAlbum

      kMDItemAlbum

      The title for a collection of media. This is analagous to a record album, or photo album. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemHasAlphaChannel

      kMDItemHasAlphaChannel

      Indicates if this image file has an alpha channel. A CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemRedEyeOnOff

      kMDItemRedEyeOnOff

      Indicates if red-eye reduction was used to take the picture. A CFBoolean.

      Possible values are 0 (no red-eye reduction mode or unknown) and 1 (red-eye reduction used).

      Available in OS X v10.4 and later.

    • kMDItemMeteringMode

      kMDItemMeteringMode

      The metering mode used to take the image. A CFString.

      Possible values are: Unknown, Average, CenterWeightedAverage, Spot, MultiSpot, Pattern, and Partial.

      Available in OS X v10.4 and later.

    • kMDItemMaxAperture

      kMDItemMaxAperture

      The smallest f-number of the lens. Ordinarily it is given in the range of 00.00 to 99.99. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFNumber

      kMDItemFNumber

      The diameter of the diaphragm aperture in terms of the effective focal length of the lens.

      Available in OS X v10.4 and later.

    • kMDItemExposureProgram

      kMDItemExposureProgram

      The class of the exposure program used by the camera to set exposure when the image is taken. Possible values include: Manual, Normal, and Aperture priority. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemExposureTimeString

      kMDItemExposureTimeString

      The time of the exposure. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemEXIFGPSVersion

      kMDItemEXIFGPSVersion

      The version of GPSInfoIFD in EXIF used to generate the metadata. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemAltitude

      kMDItemAltitude

      The altitude of the item in meters above sea level, expressed using the WGS84 datum. Negative values lie below sea level. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemLatitude

      kMDItemLatitude

      The latitude of the item in degrees north of the equator, expressed using the WGS84 datum. Negative values lie south of the equator. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemLongitude

      kMDItemLongitude

      The longitude of the item in degrees east of the prime meridian, expressed using the WGS84 datum. Negative values lie west of the prime meridian. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemTimestamp

      kMDItemTimestamp

      The timestamp on the item. This generally is used to indicate the time at which the event captured by the item took place. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemSpeed

      kMDItemSpeed

      The speed of the item, in kilometers per hour. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemGPSTrack

      kMDItemGPSTrack

      The direction of travel of the item, in degrees from true north. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemImageDirection

      kMDItemImageDirection

      The direction of the item's image, in degrees from true north. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemNamedLocation

      kMDItemNamedLocation

      The name of the location or point of interest associated with the item. The name may be user provided. A CFString.

      Available in OS X v10.6 and later.

  • Metadata attribute keys that are common to video files.

    Declaration

    Swift

    let kMDItemAudioBitRate: CFString! let kMDItemCodecs: CFString! let kMDItemDeliveryType: CFString! let kMDItemMediaTypes: CFString! let kMDItemStreamable: CFString! let kMDItemTotalBitRate: CFString! let kMDItemVideoBitRate: CFString! let kMDItemDirector: CFString! let kMDItemProducer: CFString! let kMDItemGenre: CFString! let kMDItemPerformers: CFString! let kMDItemOriginalFormat: CFString! let kMDItemOriginalSource: CFString!

    Objective-C

    const CFStringRef kMDItemAudioBitRate; const CFStringRef kMDItemCodecs; const CFStringRef kMDItemDeliveryType; const CFStringRef kMDItemMediaTypes; const CFStringRef kMDItemStreamable; const CFStringRef kMDItemTotalBitRate; const CFStringRef kMDItemVideoBitRate; const CFStringRef kMDItemDirector; const CFStringRef kMDItemProducer; const CFStringRef kMDItemGenre; const CFStringRef kMDItemPerformers; const CFStringRef kMDItemOriginalFormat; const CFStringRef kMDItemOriginalSource;

    Constants

    • kMDItemAudioBitRate

      kMDItemAudioBitRate

      The audio bit rate. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemCodecs

      kMDItemCodecs

      The codecs used to encode/decode the media. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemDeliveryType

      kMDItemDeliveryType

      The delivery type. Values are “Fast start” or “RTSP”. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemMediaTypes

      kMDItemMediaTypes

      The media types present in the content. A CFArray of CFStrings.

      Available in OS X v10.4 and later.

    • kMDItemStreamable

      kMDItemStreamable

      Whether the content is prepared for streaming. A CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemTotalBitRate

      kMDItemTotalBitRate

      The total bit rate, audio and video combined, of the media. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemVideoBitRate

      kMDItemVideoBitRate

      The video bit rate. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemDirector

      kMDItemDirector

      Directory of the movie. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemProducer

      kMDItemProducer

      Producer of the content. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemGenre

      kMDItemGenre

      Genre of the movie. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemPerformers

      kMDItemPerformers

      Performers in the movie. A CFArray of CFStrings.

      Available in OS X v10.5 and later.

    • kMDItemOriginalFormat

      kMDItemOriginalFormat

      Original format of the movie. A CFString.

      Available in OS X v10.5 and later.

    • kMDItemOriginalSource

      kMDItemOriginalSource

      Original source of the movie. A CFString.

      Available in OS X v10.5 and later.

  • Metadata attribute keys that describe an audio file.

    Declaration

    Swift

    let kMDItemAppleLoopDescriptors: CFString! let kMDItemAppleLoopsKeyFilterType: CFString! let kMDItemAppleLoopsLoopMode: CFString! let kMDItemAppleLoopsRootKey: CFString! let kMDItemAudioChannelCount: CFString! let kMDItemAudioEncodingApplication: CFString! let kMDItemAudioSampleRate: CFString! let kMDItemAudioTrackNumber: CFString! let kMDItemComposer: CFString! let kMDItemIsGeneralMIDISequence: CFString! let kMDItemKeySignature: CFString! let kMDItemLyricist: CFString! let kMDItemMusicalGenre: CFString! let kMDItemMusicalInstrumentCategory: CFString! let kMDItemMusicalInstrumentName: CFString! let kMDItemRecordingDate: CFString! let kMDItemRecordingYear: CFString! let kMDItemTempo: CFString! let kMDItemTimeSignature: CFString!

    Objective-C

    const CFStringRef kMDItemAppleLoopDescriptors; const CFStringRef kMDItemAppleLoopsKeyFilterType; const CFStringRef kMDItemAppleLoopsLoopMode; const CFStringRef kMDItemAppleLoopsRootKey; const CFStringRef kMDItemAudioChannelCount; const CFStringRef kMDItemAudioEncodingApplication; const CFStringRef kMDItemAudioSampleRate; const CFStringRef kMDItemAudioTrackNumber; const CFStringRef kMDItemComposer; const CFStringRef kMDItemIsGeneralMIDISequence; const CFStringRef kMDItemKeySignature; const CFStringRef kMDItemLyricist; const CFStringRef kMDItemMusicalGenre; const CFStringRef kMDItemMusicalInstrumentCategory; const CFStringRef kMDItemMusicalInstrumentName; const CFStringRef kMDItemRecordingDate; const CFStringRef kMDItemRecordingYear; const CFStringRef kMDItemTempo; const CFStringRef kMDItemTimeSignature;

    Constants

    • kMDItemAppleLoopDescriptors

      kMDItemAppleLoopDescriptors

      Specifies multiple pieces of descriptive information about a loop. A CFArray of CFStrings.

      Besides genre and instrument, files can contain descriptive information that help users in refining searches.

      Available in OS X v10.4 and later.

    • kMDItemAppleLoopsKeyFilterType

      kMDItemAppleLoopsKeyFilterType

      Specifies key filtering information about a loop. Loops are matched against projects that often in a major or minor key. A CFString.

      To assist users in identifying loops that will "fit" with their compositions, loops can be tagged with one of the following key filters: "AnyKey" "Minor" "Major" "NeitherKey" "BothKeys". "AnyKey" means that it fits with anything (whether in a major key, minor key or neither). "Minor" fits with compositions in a minor key. "NeitherKey" doesn't work well with compositions that are in major or minor key. "BothKeys" means it fits with major or minor key.

      Available in OS X v10.4 and later.

    • kMDItemAppleLoopsLoopMode

      kMDItemAppleLoopsLoopMode

      Specifies how a file should be played. A CFString.

      Tagged files can either be loops or non-loops (e.g., a cymbal crash). "Looping" indicates if the file should be treated as a loop. "Non-looping" indicates the file should not be treated as a loop.

      Available in OS X v10.4 and later.

    • kMDItemAppleLoopsRootKey

      kMDItemAppleLoopsRootKey

      Specifies the loop's original key. The key is the root note or tonic for the loop, and does not include the scale type. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemAudioChannelCount

      kMDItemAudioChannelCount

      Number of channels in the audio data contained in the file. A CFNumber.

      This integer value only represents the number of discreet channels of audio data found in the file. It does not indicate any configuration of the data in regards to a user's speaker setup.

      Available in OS X v10.4 and later.

    • kMDItemAudioEncodingApplication

      kMDItemAudioEncodingApplication

      The name of the application that encoded the data contained in the audio file. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemAudioSampleRate

      kMDItemAudioSampleRate

      Sample rate of the audio data contained in the file. The sample rate is a float value representing hz (audio_frames/second). For example: 44100.0, 22254.54. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemAudioTrackNumber

      kMDItemAudioTrackNumber

      The track number of a song or composition when it is part of an album. A CFNumber (integer).

      Available in OS X v10.4 and later.

    • kMDItemComposer

      kMDItemComposer

      The composer of the music contained in the audio file. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemIsGeneralMIDISequence

      kMDItemIsGeneralMIDISequence

      Indicates whether the MIDI sequence contained in the file is setup for use with a General MIDI device. A CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemKeySignature

      kMDItemKeySignature

      The key of the music contained in the audio file. For example: C, Dm, F#m, Bb. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemLyricist

      kMDItemLyricist

      The lyricist, or text writer, of the music contained in the audio file. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemMusicalGenre

      kMDItemMusicalGenre

      The musical genre of the song or composition contained in the audio file. For example: Jazz, Pop, Rock, Classical. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemMusicalInstrumentCategory

      kMDItemMusicalInstrumentCategory

      Specifies the category of an instrument. A CFString.

      Files should have an instrument associated with them ("Other Instrument" is provided as a catch-all). For some categories, such as "Keyboards", there are instrument names which provide a more detailed instrument definition, for example "Piano" or "Organ".

      Available in OS X v10.4 and later.

    • kMDItemMusicalInstrumentName

      kMDItemMusicalInstrumentName

      Specifies the name of instrument relative to the instrument category. A CFString.

      Files can have an instrument name associated with them if they have certain instrument categories. For example, the "Percussion" category has multiple instruments, including "Conga" and "Bongo".

      Available in OS X v10.4 and later.

    • kMDItemRecordingDate

      kMDItemRecordingDate

      The recording date of the song or composition. A CFDate.

      This is in contrast to kMDItemContentCreationDate which, could indicate the creation date of an edited or 'mastered' version of the original art.

      Available in OS X v10.4 and later.

    • kMDItemRecordingYear

      kMDItemRecordingYear

      Indicates the year the item was recorded. For example, 1964, 2003, etc. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemTempo

      kMDItemTempo

      A float value that specifies the beats per minute of the music contained in the audio file. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemTimeSignature

      kMDItemTimeSignature

      The time signature of the musical composition contained in the audio/MIDI file. For example: "4/4", "7/8". A CFString.

      Available in OS X v10.4 and later.

    Availability

    Available in OS X version 10.4 and later.

  • Metadata attribute keys that describe the file system attributes for a file.

    Declaration

    Swift

    let kMDItemDisplayName: CFString! let kMDItemFSContentChangeDate: CFString! let kMDItemFSCreationDate: CFString! let kMDItemFSInvisible: CFString! let kMDItemFSIsExtensionHidden: CFString! let kMDItemFSLabel: CFString! let kMDItemFSName: CFString! let kMDItemFSNodeCount: CFString! let kMDItemFSOwnerGroupID: CFString! let kMDItemFSOwnerUserID: CFString! let kMDItemFSSize: CFString! let kMDItemPath: CFString!

    Objective-C

    const CFStringRef kMDItemDisplayName; const CFStringRef kMDItemFSContentChangeDate; const CFStringRef kMDItemFSCreationDate; const CFStringRef kMDItemFSExists; const CFStringRef kMDItemFSInvisible; const CFStringRef kMDItemFSIsExtensionHidden; const CFStringRef kMDItemFSIsReadable; const CFStringRef kMDItemFSIsWriteable; const CFStringRef kMDItemFSLabel; const CFStringRef kMDItemFSName; const CFStringRef kMDItemFSNodeCount; const CFStringRef kMDItemFSOwnerGroupID; const CFStringRef kMDItemFSOwnerUserID; const CFStringRef kMDItemFSSize; const CFStringRef kMDItemPath;

    Constants

    • kMDItemDisplayName

      kMDItemDisplayName

      The localized version of the file name. A CFString.

      This is the localized version of the LaunchServices call LSCopyDisplayNameForURL/LSCopyDisplayNameForRef.

      Available in OS X v10.4 and later.

    • kMDItemFSContentChangeDate

      kMDItemFSContentChangeDate

      The date the file contents last changed. A CFDate.

      Available in OS X v10.4 and later.

    • kMDItemFSCreationDate

      kMDItemFSCreationDate

      The date and time that the file was created. A CFDate.

      Available in OS X v10.4 and later.

    • kMDItemFSExists

      kMDItemFSExists

      This attribute is deprecated and was never implemented.

      Deprecated in OS X v10.4.

    • kMDItemFSInvisible

      kMDItemFSInvisible

      Indicates whether the file is invisible. A CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemFSIsExtensionHidden

      kMDItemFSIsExtensionHidden

      Indicates whether the file extension of the file is hidden. A CFBoolean.

      Available in OS X v10.4 and later.

    • kMDItemFSIsReadable

      kMDItemFSIsReadable

      This attribute is deprecated and was never implemented.

      Deprecated in OS X v10.4.

    • kMDItemFSIsWriteable

      kMDItemFSIsWriteable

      This attribute is deprecated and was never implemented.

      Deprecated in OS X v10.4.

    • kMDItemFSLabel

      kMDItemFSLabel

      Index of the Finder label of the file. Possible values are 0 through 7. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFSName

      kMDItemFSName

      The file name of the item. A CFString.

      Available in OS X v10.4 and later.

    • kMDItemFSNodeCount

      kMDItemFSNodeCount

      Number of files in a directory. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFSOwnerGroupID

      kMDItemFSOwnerGroupID

      The group ID of the owner of the file. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFSOwnerUserID

      kMDItemFSOwnerUserID

      The user ID of the owner of the file. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemFSSize

      kMDItemFSSize

      The size, in bytes, of the file on disk. A CFNumber.

      Available in OS X v10.4 and later.

    • kMDItemPath

      kMDItemPath

      The complete path to the file. A CFString.

      Available in OS X v10.4 and later.

    Availability

    Available in OS X version 10.4 and later.