Skip to main content
Participant
Jun 12, 2011 1:40 AM UTC
Question

Sort jpgs via file list?

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 is closed to new replies. Start a new post to keep the conversation going.

17 replies

Participating Frequently
Feb 23, 2014 3:51 AM UTC

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....

Translate
Inspiring
Feb 23, 2014 9:52 AM UTC

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

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

Translate
Participating Frequently
Feb 24, 2014 6:04 PM UTC

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.

Translate
Inspiring
Jun 13, 2011 9:42 AM UTC

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?

Translate
abaskin18Author
Participant
Jun 13, 2011 7:37 PM UTC

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.

Translate
Paul Riggott
Inspiring
Jun 14, 2011 8:16 AM UTC

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;
            }
        }
}