Skip to main content
Participant
July 24, 2017
Question

Finding by sublocation

  • July 24, 2017
  • 2 replies
  • 2640 views

In the find panel, Bridge gives options for searching under a number of metadata items, but the list is not complete.  In particular, I need to search for a term under sublocation - I can't use the "all metadata" because the term I am searching for is in one of the copyright fields, and ALL of my photos thus have that term in the metadata.  Is there any way to add additional fields to the find panel?

    This topic has been closed for replies.

    2 replies

    Stephen Marsh
    Community Expert
    Community Expert
    July 27, 2017

    Paul Riggott has posted an advanced script here:

    Bridge: Ability to search by city | Photoshop Family Customer Community

    https://raw.githubusercontent.com/Paul-Riggott/PS-Scripts/master/Expert%20Search.jsx

    //This script is for expert users only!

    // https://raw.githubusercontent.com/Paul-Riggott/PS-Scripts/master/Expert%20Search.jsx

    #target bridge

    if( BridgeTalk.appName == "bridge" ) {

    expertSearch = new MenuElement("command", "Expert Search", "at the end of tools");

    }

    expertSearch.onSelect = function () {

    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

    var ns = [];

    var xmp = new XMPMeta("");

    ns= XMPMeta.dumpNamespaces();

    ns =ns.split("\n");

    var NameSpaces =[];

    for(var a in ns){

      if(a == 0) continue;

      var parts = ns.split("=>");

      if(parts.length == 2) NameSpaces.push([[parts[0].toString().replace(/^\s+|\s+$/,"")],[parts[1].toString().replace(/^\s+|\s+$/,"")]]);

      }

    var win = new Window("dialog","Expert Find");

    g = win.graphics;

    var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]);

    g.backgroundColor = myBrush;

    win.alignChildren="row";

    win.g10 = win.add('group');

    win.g10.orientation = "row";

    win.title = win.g10.add('statictext',undefined,'Expert Find');

    win.title.alignment="bottom";

    var g = win.title.graphics;

    g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);

    win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});

    win.p1.alignChildren="fill";

    win.g5 =win.p1.add('group');

    win.g5.spacing=10;

    win.g5.st1 = win.g5.add("statictext", undefined,"Prefix");

    win.g5.dd1 = win.g5.add("dropdownlist");

    win.g5.dd1.preferredSize=[100,20];

    win.g5.st2 = win.g5.add("statictext", undefined,"NameSpace");

    win.g5.dd2 = win.g5.add("dropdownlist");

    win.g5.dd2.preferredSize=[300,20];

    for(var a in NameSpaces){

      win.g5.dd1.add("item",NameSpaces[0].toString().replace(/:/g,""));

      win.g5.dd2.add("item",NameSpaces[1].toString());

      }

    win.g5.dd1.selection=0;

    win.g5.dd2.selection=0;

    win.g5.dd1.onChange = function(){

    win.g5.dd2.selection = win.g5.dd1.selection.index;

      }

    win.g5.dd2.onChange = function(){

    win.g5.dd1.selection = win.g5.dd2.selection.index;

      }

    win.g7 =win.p1.add('group');

    win.g7.spacing=10;

    win.g7.st1 = win.g7.add("statictext", undefined,"Enter Field Name...");

    win.g7.et1 = win.g7.add("edittext");

    win.g7.et1.preferredSize=[250,20];

    win.g10 =win.p1.add('group');

    win.g10.spacing=10;

    win.g10.st1 = win.g10.add("statictext", undefined,"Enter text to find...");

    win.g10.et1 = win.g10.add("edittext");

    win.g10.et1.preferredSize=[250,20];

    win.g20 =win.p1.add('group');

    win.g20.spacing=10;

    win.g20.cb1 = win.g20.add('checkbox',undefined,'Case Insensitive');

    win.g20.cb1.value=true;

    win.g100 =win.p1.add('group');

    win.g100.spacing=10;

    win.g100.bu1 = win.g100.add("button",undefined,"Process");

    win.g100.bu1.preferredSize=[270,40];

    win.g100.bu2 = win.g100.add("button",undefined,"Cancel");

    win.g100.bu2.preferredSize=[270,40];

    win.g100.bu1.onClick=function(){

    if(win.g7.et1.text == ""){

      alert("No Field Name has been entered!");

      return;

    }

    if(win.g10.et1.text == ""){

      alert("No Text to Find has been entered!");

      return;

      }

    win.close(0);

    var thumbList = [];

    app.document.deselectAll();

    var items = app.document.getSelection("jpg,tif,gif,psd,pcx,png,eps,crw,cr2,tiff,raw,rw2,dng,nef,orf,erf,mos,dcr,raf,srf,pef,x3f");

    if(win.g20.cb1.value ) var patt = new RegExp (win.g10.et1.text.toString(),"i") else var patt = new RegExp (win.g10.et1.text.toString());

    var patt2 = new RegExp (win.g7.et1.text.toString(),"i")

    for (var p in items){

      var md = items

    .synchronousMetadata;

      var xmp = new XMPMeta(md.serialize());

      iter = xmp.iterator(0, win.g5.dd2.selection.text);

      while((prop = iter.next()) != null) {

      if(prop.path != null) {

      if(patt2.test(prop.path.toString())) {

      if(patt.test(prop.value.toString())){ thumbList.push(items

    );

      }

      }

      }

      }

      }

    if(thumbList.length > 0) {

    var name =win.g7.et1.text;

    var Col = app.createCollection(name);

    app.addCollectionMember(Col,thumbList);

    app.document.thumbnail = Col;

    }

    }

    win.show();

    };

    Participant
    March 30, 2020

    Dear Adobe,

    I share Dave's frustration that simple tasks like this are very difficult to do in Adobe products.  As a DAM manager, I also want to search by different IPTC metadata fields with similar issues, and also want to see multiple metadata fields in a list view that I can sort and search on.  Usually Description/Caption is the item surprisingly missing in a list view.  For photographers who are required to send in photo shoots with captions, this often gets them in trouble as they can't see easily the files missing captions/ or poorly filled in captions to fill in before sending the shoot to the client.  Same thing goes for QCing images coming into a DAM.  I want to make sure certain metadata fields are filled in, and it is very difficult to click on each images, espcially if you have thousands.

     

    Please put a solution into development for all of your photo software products where this would make sense- ie lightroom and bridge.

     

    Sincerely,

    Christina

    Stephen Marsh
    Community Expert
    Community Expert
    March 31, 2020

    Sadly you will need to make a separate post here as this forum is generally not monitored by engineers or product managers:

     

    https://feedback.photoshop.com/photoshop_family/categories/photoshop_family_bridge

    Stephen Marsh
    Community Expert
    Community Expert
    July 24, 2017

    I’ll have more time to reply in depth later (with alternative solutions), however this should work:

    In my test, both images contained the keyword red – however one contained the sublocation blue and the other green. So they shared one metadata entry, however another metadata entry was not shared.

    The results of the find only returned the image with the blue sublocation entry, the green sublocation was excluded.

    Participant
    July 24, 2017

    Thanks, Stephen - that is an interesting approach, but it isn't working in my situation.  It turns out that the term I need to search for is in more than one field in the metadata.  I need to find all the photos I took in my city.  It would be easy if I could just search for it in the city field (forget sublocation for a moment, it turns out city is a bigger problem)  If I search under all metadata I get the records for everything in the city (city field), and any picture which has the Creator:City field filled in (basically all of them, so even if I took a picture in Peru it's linked back to my home city - not to mention Creator: Address and even my email!). The easy thing would be for Bridge to have ALL of the IPTC core items in the search menu.  I mean, it lets me search by altitude but not by city???  Anyway, thanks for the attempt.

    Stephen Marsh
    Community Expert
    Community Expert
    July 24, 2017

    Can you provide exact metadata samples or files?