Rotation and Translation depending on text inside item
Hello everyone.
If the tile of this post isn't clear i'm sorry, let me explain what i'm trying to achieve.
In my document there's 1 layer containing 4 items: text, group1, group2, group3.
My script translates and rotates group1, group2 and group3. (see code below)
I need to make the rotation and translation values depend on the word inside item text. (let's say we have 3 sets of values)
Is there a way ti achieve that? Thanks in advance
var docRef = app.activeDocument;
var layers = docRef.layers;
var myLayer = layers["LAYERNAME"]; //this defines the layer that i want to get the selection from
docRef.selection = null; //ensure there is nothing in the document selected already. this way you only get the selection you want.
for(var a=0;a<docRef.groupItems.length;a++){
if (docRef.groupItems[a].name == "group1"){
docRef.groupItems[a].selected = true;
}
}
docRef.selection[0].translate(678.1357,150.5897);
docRef.selection = null; //ensure there is nothing in the document selected already. this way you only get the selection you want.
for(var a=0;a<docRef.groupItems.length;a++){
if (docRef.groupItems[a].name == "group2"){
docRef.groupItems[a].selected = true;
}
}
docRef.selection[0].rotate(-180);
docRef.selection[0].translate(-1826.6742,+29.6273);
docRef.selection = null; //ensure there is nothing in the document selected already. this way you only get the selection you want.
for(var a=0;a<docRef.groupItems.length;a++){
if (docRef.groupItems[a].name == "group3"){
docRef.groupItems[a].selected = true;
