Skip to main content
lfcorullon13651490
Legend
November 15, 2024
Answered

[SCRIPT] Get Stacks from Thumbnails

Can anybody help? I need to get stacks from thumbnails in Bridge.

I have lots of images, some stacked, and I can't find a way, in scripting DOM, to know if that thumbnail is part of a stack. I can get the files if I loop thru app.document.stacks. But I can't get the stacks from the thumbnails. Is it even possible?

This topic is closed to new replies. Start a new post to keep the conversation going.
DeepakSinglaCorrect answer
Community Manager
November 21, 2024

Hello,

 

Thanks for reaching out. 

There is a method that can help "getStackForThumbnail()". 

This is the sample usage:

  //If a thumbanil belongs to a stack, we can get the stack object using getStackforThumbnail()
  var visibleThumbanils = app.document.visibleThumbnails;
  if (visibleThumbanils.length > 0)
  {
    var thumbnailObj = visibleThumbanils[0];
    
    // Call getStackForThumbnail to get the stack object containing this object
    var stackObject = app.document.getStackForThumbnail(thumbnailObj);
    if( stackObject )
    {
       $.writeln("This thumbnail is part of this stack object");
    }
    else
    {
        $.writeln("This thumbnail is not part of any stack object");
    }
  }

 This code is part of the Developer SDK samples, particularly file "SnpManageStacks.jsx"

 

Regards,

Deepak

2 replies

DeepakSinglaCommunity ManagerCorrect answer
Community Manager
November 21, 2024

Hello,

 

Thanks for reaching out. 

There is a method that can help "getStackForThumbnail()". 

This is the sample usage:

  //If a thumbanil belongs to a stack, we can get the stack object using getStackforThumbnail()
  var visibleThumbanils = app.document.visibleThumbnails;
  if (visibleThumbanils.length > 0)
  {
    var thumbnailObj = visibleThumbanils[0];
    
    // Call getStackForThumbnail to get the stack object containing this object
    var stackObject = app.document.getStackForThumbnail(thumbnailObj);
    if( stackObject )
    {
       $.writeln("This thumbnail is part of this stack object");
    }
    else
    {
        $.writeln("This thumbnail is not part of any stack object");
    }
  }

 This code is part of the Developer SDK samples, particularly file "SnpManageStacks.jsx"

 

Regards,

Deepak

Translate
lfcorullon13651490
Legend
November 21, 2024

Thank you so much.

This is not in the any documentation I have access.

Translate