Adobe 65007312 Programming Guide - Page 75
Custom metadata tagset example, Searching for photos by metadata values
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 75 highlights
CHAPTER 4: Working with Metadata Searching for photos by metadata values 75 X The special name 'com.adobe.label' inserts a section label in the Metadata panel, specified by a label entry in an array with this name. A label is typically used below a separator. Custom metadata tagset example This sample metadata-tagset provider script defines a set of metadata fields. return { title = LOC "$$$/SampleTagset/Title=Sample Tagset from Plug-in", id = 'sampleTagset', items = { 'com.adobe.filename', 'com.adobe.copyname', 'com.adobe.folder', 'com.adobe.separator', 'com.adobe.title', { 'com.adobe.caption', height_in_lines = 3 }, 'com.adobe.separator', { 'com.adobe.label', label = LOC "$$$/Metadata/SampleLabel=Section Label" }, 'com.adobe.dateCreated', 'com.adobe.location', 'com.adobe.city', 'com.adobe.state', 'com.adobe.country', 'com.adobe.isoCountryCode', 'com.adobe.GPS', 'com.adobe.GPSAltitude', 'com.adobe.lightroom.metadata.sample.randomString', }, } Searching for photos by metadata values The LrCatalog object provides a function, findPhotos(), that allows you to search through the catalog for photos with particular metadata values. You pass this function a search descriptor to define the search, which is a table containing a metadata field (the search criteria), a matching operation (which depends on the datatype of the field), and a value to match against. This function must be used within a background task. For example: import "LrTasks".startAsyncTask( function() local catalog = import "LrApplication".activeCatalog() local photos = catalog:findPhotos { searchDesc = { criteria = "rating", operation = ">", value = 3,