Skip to main content
Known Participant
April 22, 2012
Answered

Using RAW+JPEG stacking script, but can't get JPEG as default thumbnail for stack. Help!

  • April 22, 2012
  • 1 reply
  • 4307 views

I am currently using this script I found elsewhere on Adobe forums. However, doing this function only will stack everything with the raw files on top. I am using a 5D MKIII now and Bridge CS4 can't generate the CR2 previews, so I need JPEGs to see what a file is for general editing. How do I get this stack script to put the JPEGS on top instead of the raw files?

(script originally posted by Paul Riggot in another forum)

#target bridge  

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

AutoStack = MenuElement.create("command", "Auto Stack", "at the beginning of submenu/Stack", "zx1");

}

AutoStack.onSelect = function () {

   stackEm();

   }

function stackEm(){

app.document.sorts = [{ name:"name",type:"string", reverse:false}];

var jpgs = Folder(app.document.presentationPath).getFiles ("*.jpg");

app.document.deselectAll();

for(var a in jpgs){

var Name = decodeURI(jpgs.name).replace(/\.[^\.]+$/, '');

var stacks = Folder(app.document.presentationPath).getFiles(Name+".*");

if(stacks.length < 2) continue;

for(var z in stacks){ app.document.select(new Thumbnail(stacks));}

StackFiles();

app.document.deselectAll();

}

function StackFiles(){

app.document.chooseMenuItem('submenu/Stack');

app.document.chooseMenuItem('StackGroup');

This topic has been closed for replies.
Correct answer Paul Riggott

Hopfully this should work now, I have now changed the sort order so the jpg is first...

#target bridge  

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

AutoStack = MenuElement.create("command", "Auto Stack", "at the beginning of submenu/Stack", "zx1");

}

AutoStack.onSelect = function () {

app.document.sorts = [{ name:"name",type:"string", reverse:true}];

var jpgs = Folder(app.document.presentationPath).getFiles ("*.jpg");

app.document.deselectAll();

for(var a in jpgs){

var Name = decodeURI(jpgs.name).replace(/\.[^\.]+$/, '');

var stacks = Folder(app.document.presentationPath).getFiles(Name+".*");

if(stacks.length < 2) continue;

for(var z in stacks){ app.document.select(new Thumbnail(stacks));}

app.document.chooseMenuItem('StackGroup');

app.document.deselectAll();

}

app.document.sorts = [{ name:"name",type:"string", reverse:false}];

}


Paul Riggott
Paul RiggottCorrect answer
Inspiring
April 22, 2012

Hopfully this should work now, I have now changed the sort order so the jpg is first...

#target bridge  

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

AutoStack = MenuElement.create("command", "Auto Stack", "at the beginning of submenu/Stack", "zx1");

}

AutoStack.onSelect = function () {

app.document.sorts = [{ name:"name",type:"string", reverse:true}];

var jpgs = Folder(app.document.presentationPath).getFiles ("*.jpg");

app.document.deselectAll();

for(var a in jpgs){

var Name = decodeURI(jpgs.name).replace(/\.[^\.]+$/, '');

var stacks = Folder(app.document.presentationPath).getFiles(Name+".*");

if(stacks.length < 2) continue;

for(var z in stacks){ app.document.select(new Thumbnail(stacks));}

app.document.chooseMenuItem('StackGroup');

app.document.deselectAll();

}

app.document.sorts = [{ name:"name",type:"string", reverse:false}];

}


Known Participant
April 22, 2012

Wow such a quick fix. Thanks!!! This works. This is a great supplement until I get CS5 or LR4.


The only problem is that bridge does not link file actions to all files in the stack still have to click delete twice and use star ratings twice etc...

Are stacks natively all inclusive to file ratings and deletes or has the script changed that?

Paul Riggott
Inspiring
April 22, 2012

What you can do is select all the stacks then Stacks - Open Stack, you can then select the documents you want to rate/label. To close select all stacks and Stacks - Close Stack.

The script won't change the normal behaviour.

Hope this helps.