System.Shell.Item.metadata method

[ The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Retrieves the metadata value for a canonical property name key of the System.Shell.Item.

Syntax

objRetVal = System.Shell.Item.metadata(
  sMetadata
)

Parameters

sMetadata [in]

String that specifies the metadata key.

Return value

The metadata value.

Remarks

Metadata keys can be obtained from the Details tab of the Properties dialog for an item.

Note

The following list provides examples of metadata that can be retrieved for particular file types.

  • Graphics

    Width, Height, Resolution, Bit depth

  • Video

    Bit rate, Frame rate, Sample size

  • Audio/Music

    Artist, Album, Year, Track, Genre, Lyrics, Duration

  • Documents

    Author, Title, Subject, Owner

Examples

The following example demonstrates how to retrieve the "Owner" of an object dropped on a gadget.

// --------------------------------------------------------------------
// Display the names of objects dropped on the gadget.
// --------------------------------------------------------------------
function GetItemFromDrop()
{    
    spFeedback.innerHTML = "Item(s) dropped.<br/>";
    var intIndex = 0;
    var oItem;
    var sItem;
    while(oItem = System.Shell.itemFromFileDrop(event.dataTransfer, intIndex))
    {
        // Display object properties and increment the index.
        sItem = "Other: ";
        if (oItem.isFileSystem == true)
        {
            sItem = "File: ";
        }
        if (oItem.isFolder == true)
        {
            sItem = "Folder: ";
        }
        if (oItem.isLink == true)
        {
            oLinkItem = oItem.link;
            sItem = "Link (" + oLinkItem.path + "): ";
        }
        spFeedback.innerHTML += sItem;
        spFeedback.innerHTML += oItem.name + "<br/>"; 
        spFeedback.innerHTML += "metadata: " + oItem.metadata("Owner") + "<br/>";
        
        intIndex++;
    }
}

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)