Stdlib bug in hasBG

Discussion of the xtools Toolkit

Moderators:xbytor, DavideBarranca, Paul MR

Post Reply
Paul MR
Stdlib bug in hasBG

Post by Paul MR » Tue May 10, 2011 7:19 pm

Hi x, this function will fail as it's trying to get ref and should be bgref
Code: Select allStdlib.hasBG = function(doc) {
  try {
    var bgref = new ActionReference();
    bgref.putIndex(cTID("Lyr "), 0);
    executeActionGet(ref);
    return true;
  } catch (e) {
    return false;
  }
}

xbytor

Stdlib bug in hasBG

Post by xbytor » Wed May 11, 2011 2:20 am

Right, you are. I normally use Stdlib.hasBackground(), the DOM-style version.

I'll make the change and push it out to sourceforge later tonight.

Thanks for the find.

xbytor

Stdlib bug in hasBG

Post by xbytor » Wed May 11, 2011 2:55 am

I dropped in the fix and also made the change to account for the new BridgeTalk.appVersion format for PSCS5.5.

Post Reply