Bridge sort by number of keywords...

New Here ,
Dec 21, 2017 Dec 21, 2017

Copy link to clipboard

Copied

Hi there,

so I use the Windows Version of Bridge 5.1...NO CC.

I found a keyword Counter for each Foto/Illustration...but did not finding a keyword Counter for the hole Folder.

When I am in a Folder I could go to VIEW --> SORT IT --> NAME...TYPE etc. but there is NO Chance to sort it by the number of keywords.

To hover on each file is really a pain, when there are thousands of files in the Folder...

I want to sort by the number of keywords: for example 70 at the top...69...68...!

Is there any script given, or some other Chance to make this happen ?

Thanks for your time.

All the best,

Frank

Views

758

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Dec 23, 2017 Dec 23, 2017

This version will let you select as many files as you wish, after you have made your selections press the "Select the selected" button.

Hope this works

#target bridge;

onDocLoadEvent = function( event ){

if(event.object instanceof Document){

    if( event.type == "loaded" ){

          $.sleep(1000);

                keyCount();

            }

        }

        return { handled: false };

}

app.eventHandlers.push( { handler: onDocLoadEvent} );

function keyCount(){

try{ 

sPalette = new TabbedPalette( app.document

...

Likes

Translate

Translate
Guide ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

Okay I dont't think you will get what you want, here is a very poor compromise.

To Install see Prepression: Downloading and Installing Adobe Scripts

This script creates  a tabbed palette, in the bottom left hand corner of Bridge

Once you have selected your folder click the process button.

It will create a list of all files with the number of keywords associated with it.

If you click on a file name in that window it will reveal that file and select it.

Hope it is of some use?

Also it will tell you how many keywords in total there are.

N.B. You need to click process if you change folder to update the details.

The font is very small but due to Adobe not fixing thier bugs there is nothing I can do about it, last good version was Bridge CS5 and it has got worse with every new version.

#target bridge;

onDocLoadEvent = function( event ){

if(event.object instanceof Document){

    if( event.type == "loaded" ){

          $.sleep(1000);

                keyCount();

            }

        }

        return { handled: false };

}

app.eventHandlers.push( { handler: onDocLoadEvent} );

function keyCount(){

try{ 

sPalette = new TabbedPalette( app.document, "KeyTest", "test", "script","left","bottom");

pnl1 = sPalette.content.add('panel');

pnl1.alignChildren="left";

pnl1.addBtn = pnl1.add('button', undefined, 'Process');

pnl1.txtF = pnl1.add('edittext', undefined, "                                               ");

pnl1.addBtn.preferredSize=[50,25];

pnl1.txtField = pnl1.add('listbox');

pnl1.txtField.preferredSize=[200,200];

//should work but doesn't blame Adobe!

pnl1.txtField.graphics.font = "dialog:24";

pnl1.addBtn.onClick = function(){

pnl1.txtField.text ="";

var thumbs = app.document.visibleThumbnails;

var List =[];

var tCount =0;

for(var a in thumbs){

if(!thumbs instanceof File) continue;

var md = thumbs.synchronousMetadata;

try{

md.namespace = "http://ns.adobe.com/photoshop/1.0/";

var count = md.Keywords.length;

tCount += count;

List.push([[decodeURI(thumbs.spec.name)],[count]]);

}catch(e){}

}

List = List.sort(function(a,b){return a[1]-b[1];});

List.reverse();

pnl1.txtF.text = "Total Keyword Count = " + tCount.toString();

pnl1.txtField.removeAll();

for(var z in List) {pnl1.txtField.add("item",List.toString());}

pnl1.txtField.selection=0;

pnl1.txtField.onChange = function(){

app.document.deselectAll();

app.document.select(new Thumbnail(app.document.presentationPath + "\\" + List[this.selection.index][0]));

app.document.reveal(new Thumbnail(app.document.presentationPath + "\\" + List[this.selection.index][0]));

    }

}       

sPalette.content.layout.layout(true);

}catch(e){$.writeln(e + "\n" + e.line);}

};

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

Hello SuperMerlin,

thanks for your answer, your time and your efforts.

Trying and install the script...but you are right, this is not what I am looking for.

The files are sortet by keyword numbers in the Little window...BUT the file numers are not in secuance.

For example:

12583.jpg = 55 keywords

20585.jpg = 55 keywords

2407.jpg = 55 keywords

19387.jpg = 55 keywords

So in the Folder there are thousands of files...and searching by file Name cost a lot of time.

Maybe there is an more practical way !?

Thanks and best regards,

Frank

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 22, 2017 Dec 22, 2017

Copy link to clipboard

Copied

Just click on the filename you want and it will select it for you.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 23, 2017 Dec 23, 2017

Copy link to clipboard

Copied

Hello SuperMerlin,

oh...that I didnt read at the first time.

Is there a Chance to select MORE THAN ONE in the selection box ?

THIS would be perfect...

In the script I had the field high increased and the font size reduced.

But didnt get mark more than one file...

THANKS for your help and your time.

Best regards,

Frank

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 23, 2017 Dec 23, 2017

Copy link to clipboard

Copied

This version will let you select as many files as you wish, after you have made your selections press the "Select the selected" button.

Hope this works

#target bridge;

onDocLoadEvent = function( event ){

if(event.object instanceof Document){

    if( event.type == "loaded" ){

          $.sleep(1000);

                keyCount();

            }

        }

        return { handled: false };

}

app.eventHandlers.push( { handler: onDocLoadEvent} );

function keyCount(){

try{ 

sPalette = new TabbedPalette( app.document, "KeyTest", "test", "script","left","bottom");

pnl1 = sPalette.content.add('panel');

pnl1.alignChildren="left";

pnl1.addBtn = pnl1.add('button', undefined, 'Process');

pnl1.txtF = pnl1.add('edittext', undefined, "                                               ");

pnl1.addBtn.preferredSize=[150,25];

pnl1.selBtn = pnl1.add('button', undefined, 'Select the selected');

pnl1.selBtn.preferredSize=[150,25];

pnl1.txtField = pnl1.add('listbox', undefined, undefined, { multiselect: true } );

pnl1.txtField.preferredSize=[200,200];

//should work but doesn't blame Adobe!

pnl1.txtField.graphics.font = "dialog:24";

pnl1.addBtn.onClick = function(){

pnl1.txtField.text ="";

var thumbs = app.document.visibleThumbnails;

var List =[];

var tCount =0;

for(var a in thumbs){

if(!thumbs instanceof File) continue;

var md = thumbs.synchronousMetadata;

try{

md.namespace = "http://ns.adobe.com/photoshop/1.0/";

var count = md.Keywords.length;

tCount += count;

List.push([[decodeURI(thumbs.spec.name)],[count]]);

}catch(e){}

}

List = List.sort(function(a,b){return a[1]-b[1];});

List.reverse();

pnl1.txtF.text = "Total Keyword Count = " + tCount.toString();

pnl1.txtField.removeAll();

for(var z in List) {pnl1.txtField.add("item",List.toString());}

pnl1.selBtn.onClick=function(){

app.document.deselectAll();

var sels = pnl1.txtField.selection;

for(var r in sels){ app.document.select(new Thumbnail(app.document.presentationPath + "\\" +sels.toString().split(",")[0])); }

}        }

sPalette.content.layout.layout(true);

}catch(e){$.writeln(e + "\n" + e.line);}

};

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 23, 2017 Dec 23, 2017

Copy link to clipboard

Copied

SuperMerlin,

YOU ARE THE BEST !

This works and save me many many hours of wasted time !

THANK YOU so much !!

Really great...

Wish you peaceful Holidays and best regards,

Frank

AAAAA+++++

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 23, 2017 Dec 23, 2017

Copy link to clipboard

Copied

LATEST

Merry Christmas and Happy New Year to you too!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
express Get Adobe Express free

Easily make social graphics, flyers, logos, and more from thousands of free templates.

Get free app
Free to use, no credit card required