Adobe 65007312 Programming Guide - Page 79
Combining search criteria, value
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 79 highlights
CHAPTER 4: Working with Metadata Searching for photos by metadata values 79 thisMonth thisYear "is in this month" "is in this year" value The value to match against must be of the type indicated for the criteria. Additional parameters value2 and value_unit are used with specific types and operations, as mentioned above. Combining search criteria You can create a more complex search descriptor by using a combine entry to specify how to combine the results of several criterion tables: import "LrTasks".startAsyncTask( function() local catalog = import "LrApplication".activeCatalog() local photos = catalog:findPhotos { searchDesc = { combine = "intersect", { criteria = "rating", operation = ">", value = 3, }, { criteria = "captureDate", operation = ">", value = "2007-01-01", } }, } for _, photo in ipairs( photos ) do -- do something with path end end ) There are three ways to combine criteria: combine = "union" combine = "intersect" combine = "exclude" Any of the criteria match. All of the criteria match. None of the criteria match. A combine entry is followed by an array of elements to be combined. This array can contain nested combine entries, so the search can become quite complex. For example: { combine = "union", { combine = "intersect", { criteria = "rating",