Stdlib bug in hasBG

Discussion of the xtools Toolkit

Moderators: Tom, Kukurykus

Paul MR

Stdlib bug in hasBG

Post by Paul MR »

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 »

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 »

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