Question
Why does Bridge hang when selecting thumbs
I've been working on a script that looks through all the currently visible images in Bridge and selects a subset of them. In my case, I'm selecting only the latest version of an image (e.g. the PSD, not the NEF). My code logic is working to identify the thumbs that I want to select, but when I try to actually select them in Bridge, I find that Bridge hangs.
The whole script is a bit complicated, but the relevant part to my problem is:
for (i = 0; i < fileNames.length; i++)
{
if (!fileNames.hasDerivative)
{
var thumbObj = currentThumbs[fileNames.thumbIndex];
app.document.select(thumbObj);
}
}
If I comment out the app.document.select line, the script works perfectly. I've even written debugging code that verifies that my script finds all the right thumbs. But, when I try to actually select them in Bridge, Bridge hangs and I have to kill it from task manager.
Is there something I'm either doing wrong or need to know about app.document.select(thumb) in Bridge? Why would that call hang? Could I somehow be passing an invalid thumb to this function? Is there a way I can write debugging code to test if it's a valid thumb I'm passing in all cases?
--John
The whole script is a bit complicated, but the relevant part to my problem is:
for (i = 0; i < fileNames.length; i++)
{
if (!fileNames.hasDerivative)
{
var thumbObj = currentThumbs[fileNames.thumbIndex];
app.document.select(thumbObj);
}
}
If I comment out the app.document.select line, the script works perfectly. I've even written debugging code that verifies that my script finds all the right thumbs. But, when I try to actually select them in Bridge, Bridge hangs and I have to kill it from task manager.
Is there something I'm either doing wrong or need to know about app.document.select(thumb) in Bridge? Why would that call hang? Could I somehow be passing an invalid thumb to this function? Is there a way I can write debugging code to test if it's a valid thumb I'm passing in all cases?
--John
