Hi, I have this script which works but am getting an error:
Can't find method com.scriptographer.ai.Item.appendTop(org.mozilla.javascript.Undefined).
at Scriptographer Scripts/zz_test/textBoxGroup.js:31
at Scriptographer Scripts/zz_test/textBoxGroup.js:24
Anyone have a suggestion? Here is the script:
//take a text item above an object on the same layer and group them.
var layer = document.activeLayer;
print(layer.name);
var text = document.getItems({
type: 'TextItem',
selected: true,
//isDescendant(layer): true,
});
var box = document.getItems({
type: 'Path',
selected: true,
//isDescendant(layer): true,
});
var textClone = text.clone();
var boxClone = box.clone();
for (i=0;i<text.length + box.length;i++) {
console.log("Selected Items" + 'r' + text);
if (layer.children.length != 0){
textBoxGroup(text[i], box[i]);
}
}
function textBoxGroup(test, test2) {
if (textClone.position == boxClone.position) {
var textBox= new Group();
textBox.appendTop(test);
textBox.appendBottom(test2);
}
}