Sg2.9
take a text item and group it...
Recent RSS
take a text item and group it with a path below it
From:  chris h
Date:  6. November 2012, 20:40

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);
}
}

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Growth2 and its partner 03.08.12