There still two bugs related to scripting in Adobe Bridge in the latest update.
- The command is not checkable also it is executed.
- The multiline label item doesn’t have a scroll to reveal the rest of lines.
The code is for Tree Shade extension and you can find it in Adobe Exchange.
https://exchange.adobe.com/apps/cc/13737/tree-shade
It was working well in the previous versions. Is there any required code updating or it’s a Bridge bugs?
The first issue code snippet:
var switchWithInDesignCommand = new MenuElement( "command", "Switch With InDesign", "at the end of treeShadeMenu", "switchWithInDesignCommand");
switchWithInDesignCommand.onSelect = function (m)
{
switchWithInDesignHandler ();
};
switchWithInDesignCommand.onDisplay = function()
{
if (tsIsSwitchWithInDesign) {
switchWithInDesignCommand.checked = true; // doesn't work
}
else {
switchWithInDesignCommand.checked = false; // doesn't work
}
};
The second issue code snippet:
// GROUP1
// ======
var group1 = dialog.add("group", undefined, {name: "group1"});
group1.orientation = "column";
group1.alignChildren = ["fill","top"];
group1.spacing = 10;
group1.margins = 0;
var staticText = group1.add("statictext", undefined, '', {name: "staticText", multiline: true, scrolling: true});
staticText.preferredSize.width = 600;
staticText.preferredSize.height = (15 * theLabelArr.length) + 10;
if (staticText.preferredSize.height > 200) {
staticText.preferredSize.height = 200;
}
for (var tla = 0; tla < theLabelArr.length; tla++) {
staticText.text += theLabelArr[tla];
if (tla < theLabelArr.length - 1) {
staticText.text += "\n";
}
}
if (isMultiLine) {
tsEditText = group1.add('edittext {properties: {name: "tsEditText", multiline: true, scrollable: true}}');
tsEditText.preferredSize.width = 600;
tsEditText.preferredSize.height = 100;
}
else {
tsEditText = group1.add('edittext {properties: {name: "tsEditText"}}');
tsEditText.preferredSize.width = 600;
}
tsEditText.text = theOldText;
tsEditText.addEventListener ('focus', edtActivate, false);
function edtActivate () {
if (tsTextEditorOpened) {
//app.document.chooseMenuItem("mondo/command/paste");
}
else {
//app.document.chooseMenuItem("mondo/command/selectAll");
}
}
To see a screenshots check this issue in the community forum: