Mac OS X

  1. Spotlight Metadata Attributes
  2. Image
  3. Video
  4. Audio
  5. File System
Query Expression Syntax

Spotlight Metadata Attributes

name prefix is kMDitem
header is CoreServices/CoreServices.h/MDitem.h
attribute Description Value Type
prefix with CF
AttributeChangeDate change made to a metadata attribute. Date
Audiences determined by the creator or the publisher or by a third party. Array ofStrings
Authors order of the authors is preserved, but does not represent the main author or relative importance of the authors. Array ofStrings
City example, "New York", "Cupertino", or "Toronto". String
Comment not displayed by the Finder. String
ContactKeywords excluding authors. Array ofStrings
ContentCreationDate Date
ContentModificationDate Date
ContentType Uniform Type Identifier. For example, a jpeg image file will have a value of public.jpeg. The value of this attribute is set by the Spotlight importer.
Changes to this value are lost when the file attributes are next imported.

marked as nosearch. specify this attribute key explicitly in a query in order for its contents to be searched.

String
ContentTypeTree Uniform Type Identifier hierarchy of the file. For example, a jpeg image file will return an array containing ¿public.jpeg¿, ¿public.image¿, and ¿public.data¿. The value of this attribute is set by the Spotlight importer.
Changes to this value are lost when the file attributes are next imported.


This attribute is marked as nosearch. specify this attribute key explicitly in a query in order for its contents to be searched.

Array ofStrings
Contributors responsible Entities . Examples of a contributor include a person, an organization or a service. Array ofStrings
Copyright String
Country 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. String
Coverage Extent or scope of the content of the resource. typically includes
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, named places or time periods be used in preference to numeric identifiers such as sets of co-ordinates or date ranges.
String
Creator application used . For example, "Pages" or "Keynote". Strinb
Description String
DisplayName Localized version of the file name. This is the localized version of the LaunchServices call LSCopyDisplayNameForURL() / LSCopyDisplayNameForRef() . String
DueDate Date
DurationSeconds 10.5 represents media that is 10 and 1/2 seconds long. NumberUnits seconds
EmailAddresses Array ofStrings
EncodingApplications used to convert the original content into it's current form. For example, a PDF file might have an encoding application set to "Distiller". Array ofStrings
FinderComment String
Fonts full name, the postscript name, or the font family name, based on the available information. Array ofStrings
Headline Publishable entry providing a synopsis of the contents of the item. For example, "Apple Introduces the iPod Photo". String
Identifier Formal identifier used to reference the resource within a given context. For example, the Message-ID of a mail message. String
InstantMessageAddresses Array ofStrings
Instructions such as embargoes and warnings. For example, "Second of four stories". String
Keywords examples: "Birthday", "Important", etc. Array ofStrings
Kind String
Languages by the item. The recommended best practice for the values of this attribute are defined by RFC 3066. Array ofStrings
LastUsedDate 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. Date
NumberOfPages Number
Organizations Companies or organizations that created the document. Array ofStrings
PageHeight in points (72 points per inch). For PDF files this indicates the height of the first page only. NumberUnitsg points
PageWidth in points (72 points per inch). For PDF files this indicates the width of the first page only. NumberUnitsg points
PoneNumbers . Array ofStrings
Projects example, if you were working on a movie, all of the files could be marked as belonging to the project ¿My Movie¿. Array ofStrings
Publishers example, a person, an organization, or a service. Array ofStrings
Recipients . Array ofStrings
Rights Provides a link to information about rights held on the document. Contains a rights management statement for the document, 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 document. String
SecurityMethod Encryption method used to make the item secure. PDF files return "None" or "Password Encrypted". String
StarRating User rating of this item. For example, the user rating (number of stars) of an iTunes track. Number
StateOrProvince of origin according to guidelines established by the provider. For example, "CA", "Ontario", or "Sussex". String
Contains a text representation of the content of the document. Data in multiple fields should be combined using a whitespace character as a separator. An application's Spotlight importer provides the content of this attribute.

Applications can create queries using this attribute, but are not able to read the value of this attribute directly.

String
Title example, this could be the title of a document, the name of an song, or the subject of an email message. String
Version String
kereFroms Describes where the item was obtained from. For example, a downloaded file may refer to the URL, files received by email may indicate the sender¿s email address, message subject, etc. Array ofStrings
AcquisitionMake Manufacturer of the device used to acquire the document contents. String
AcquisitionModel String
Album Title for the collection containing this item. This is analogous to a record label or photo album. String
Aperture used to aqure the document contents. is the APEX value. Number
BitsPerSample 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..). Number
ColorSpace model used by the document contents. For example, ¿RGB¿, ¿CMYK¿, ¿YUV¿, or ¿YCbCr¿. String
EXIFVersion . String
ExposureMode NumberExpected Values 0 (auto exposure),
1 (manual exposure),
2 (auto bracket)
ExposureProgram used by the camera to acquire the document contents. Possible values include: Manual, Normal, Aperture priority, etc. String
ExposureTimeSeconds NumberUnitsg seconds
ExposureTimeString corresponds to when a photograph is exposed. String
FNumber Diameter of the aperture relative to the effective focal length of the lens. Number
FlashOnOff Boolean
FocalLength millimeters. NumberUnitsg millimeters
HasAlphaChannel Boolean
ISOSpeed For example, 100, 200, 400, etc. NumberUnitsg ISO Speed
LayerNames Array ofStrings
MaxAperture Smallest F number of the lens in APEX value units, usually in the range of 00.00 to 99.99. Number
MeteringMode StringExpected Values Unknown, Average, CenterWeightedAverage, Spot, MultiSpot, Pattern, Partial
Orientation NumberExpected Values 0 (landscape), 1 (portrait)
PixelHeight example, the image height or the video frame height. NumberUnitsg pixels
PixelWidth example, the image width or the video frame width. NumberUnitsg pixels
ProfileName String
RedEyeOnOff BooleanExpected Values 0 (no red-eye reduction mode or unknown), 1 (red-eye reduction used)
ResolutionHeightDPI NumberUnitsg dots per inch (DPI)
ResolutionWidthDPI NumberUnitsg dots per inch (DPI)
WhiteBalance NumberExpected Values 0 (auto white balance), 1 (manual)

Metadata attribute keys that are common to video files.

AudioBitRate Number
Codecs used to encode/decode the media. Array ofStrings
DeliveryType Method used to deliver streaming media. StringExpected Values "Fast Start", "RTSP"
MediaTypes example, a QuickTime movie may return:

MediaTypes = (Sound, Video, "Hinted Video Track", "Hinted Sound Track")
MediaTypes = (Sound, Video)
MediaTypes = ("MPEG1 Muxed")
Array ofStrings
Streamable Boolean
TotalBitRate audio and video combined, of the media. Number
VideoBitRate Number

Audio Metadata Attribute Keys

class="spaceabove"

Metadata attribute keys that describe an audio file.

Specifies multiple pieces of descriptive information about a loop. Besides genre and instrument, files can contain descriptive information that help users in refining searches. Array ofCFStrings
Specifies key filtering information about a loop. Loops are matched against projects that often differ in a major or minor key. 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", or "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 compositions that are in major or minor key. StringExpected Values "AnyKey", "Minor", "Major" , "NeitherKey", "BothKeys"
Specifies how a file should be played. 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. StringExpected Values "Looping", "Non-looping"
Specifies the loop's original key. The key is the root note or tonic for the loop, and does not include the scale typeStringExpected Values "C", "C#/Db", "D", "D#/Eb", "E", "F", "F#/Gb", "G", "G#/Ab", "A", "A#/Bb", "B", "NoKey"
AudioChannelCount Number of channels in the audio data contained in the file. This integer value only represents the number of discrete 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. Number
AudioEncodingApplication String
AudioSampleRate The sample rate is a float value representing hz (audio_frames/second). For example: 44100.0, 22254.54. NumberUnitsg hz (audio_frames/second)
AudioTrackNumber when it is part of an album. Number
Composer String
IsGeneralMIDISequence Boolean
KeySignature example: "C", "Dm", "F#m", "Bb". String
Lyricist String
MusicalGenre example: "Jazz", "Pop", "Rock", "Classical". String
("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". String
relative to the instrument category. 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". String
RecordingDate of the song or composition. This is in contrast to ContentCreationDate which, could indicate the creation date of an edited or "mastered" version of the original art. Date
RecordingYear 1964, 1995, 1997, or 2003. Number
Tempo floating point Beats per Minute (BPM)
TimeSignature Time signature of the musical composition contained in the audio/MIDI file. For example: "4/4", "7/8". String

Metadata attribute keys that describe the file system attributes for a file.
available for files on any mounted volume.

Date
FSCreationDate Date
FSInvisible Boolean
Boolean
FSLabel Index of the Finder label of the file. values are 0 through 7. Number
FSName File name of the item. String
FSNodeCount Number of files in a directory. Number
FSOwnerGroupID Number
FSOwnerUserID Number
FSSize bytes NumberUnits bytes
Path Complete path to the file. This value of this attribute can be retrieved, but can't be used in a query or to sort search results. This attribute can¿t be used as a member of the valueListAttrs array parameter for MDQueryCreate or MDQueryCreateSubset. String
Aparently from Developer.apple.com/…/Carbon&helllip;MDItemRef…