Skip to main content
Participant
June 12, 2011
Question

Sort jpgs via file list?

  • June 12, 2011
  • 2 replies
  • 2596 views

Would is be possible to write a custom manual bridge sort file (hidden file)?

The  idea would be able take a list of jpegs in a specific order and get  Bridge to to sort them according to the order on the list via preserved filename metadata.  Say an ordered list of images for an animated sequence?

Any advice and or a script would be great!

Thanks!

This topic has been closed for replies.

2 replies

Participating Frequently
February 23, 2014

Did you ever find a script for doing this? My job would be so much easier if bridge could sort based on a cut list/test list....

Inspiring
February 23, 2014

That might be possible by re-writing the .BridgeSort file as in the post below.

http://forums.adobe.com/thread/1078601?tstart=0

Participating Frequently
February 24, 2014

Hmmmm... as far as I can tell, that script is still sorting by attributes, not a list? I would need to sort the files by name in a seemingly random order that exists in simple list format.

Inspiring
June 13, 2011

I have not tried this but a brief look at the guide suggests that you can create your own 'SortCriterion object' this should allow for you to sort based on an xmp metadata field is this where your sort info is?

abaskin18Author
Participant
June 13, 2011

Could be a step in the right direction.  It would certainly connect the dots between the file list and the preserved filename in metadata, but finding the right jpegs isn't really the time suck on these tasks.  It's really getting them in the right order per a text file listing that order that takes so much time manually.

Paul Riggott
Inspiring
June 14, 2011

If the preserved filenames are in the order you want, you could copy the selected files to another folder and rename then back to the preserved filename IE:


var toFind = new Array();
var txtFile = File.openDialog("Please select the text file","*.txt");
txtFile.open('r');
while (newLine = txtFile.readln()) {
     if (newLine.length < 2) continue;
toFind.push(newLine.replace(/^[\s]+|[\s]+$/g, ''));
}
txtFile.close();
var Thumbs = app.document.visibleThumbnails; 
var fileList =[];
for(var a in Thumbs){
var t = new Thumbnail(Thumbs);
var md = t.synchronousMetadata
md.namespace = "
http://ns.adobe.com/xap/1.0/mm/"
var PreservedFileName = md.PreservedFileName;
fileList.push([[Thumbs.spec],[PreservedFileName]]);
}
var thisFolder = app.document.presentationPath;
var outFolder = Folder(thisFolder +"/Working");
if(!outFolder.exist) outFolder.create();
for (var z in toFind){
    for(var v in fileList){
        if(toFind.toString().toLowerCase() == fileList[1].toString().toLowerCase()){
            new Thumbnail(File(fileList[0])).copyTo(outFolder);
            File(outFolder+"/"+File(fileList[0]).name).rename(fileList[1].toString());
            break;
            }
        }
}