Copy link to clipboard
Copied
Hello everyone,
i have a doubt what is use of method translate or transform.
suppose i am having a text frame how to move this text frame if is an point type text.
1
*
star text is located down 1 is located above how to move this star close to 1 like *1 can anybody explain me with an example.
with regards,
yuvi
Copy link to clipboard
Copied
Reference each geometrical position. In this case, You can use thte geometricBounds property and the width property like below
var pos = app.activeDocument.textFrames[0].position;
app.activeDocument.textFrames[1].position
= [pos[0] - app.activeDocument.textFrames[1].width,
app.activeDocument.textFrames[0].position[1]];
Copy link to clipboard
Copied
can you make corrections in my code sir
Copy link to clipboard
Copied
hello sir ,
still i am facing this problem !! can you help me?
Copy link to clipboard
Copied
Thanks for the reply ,
here is my requirement
i have also written code
read_star(activeDocument.groupItems);
function read_star(Grps)
{
var lay_i, txt_i, x, y, xx, xy, count, txtFramesLen, t, t1;
for (lay_i = 0; lay_i < Grps.length; lay_i++) {
if (Grps[lay_i].locked) Grps[lay_i].locked = false;
if (Grps[lay_i].name != "NUMBER") continue;
txtFramesLen = Grps[lay_i].textFrames.length;
for (txt_i = txtFramesLen - 1; txt_i >= 0; txt_i--) {
var text_frame = Grps[lay_i].textFrames;
if(text_frame[txt_i].characters.length==1)
{
if(text_frame[txt_i].textRange.characterAttributes.size==14 ||text_frame[txt_i].textRange.characterAttributes.size==12)
{
if(text_frame[txt_i].contents=="*")
text_frame[txt_i].textRange.characterAttributes.size=7.5;
t7 = Math.round(text_frame[txt_i].anchor[1]);
t8 = (Math.round(text_frame[txt_i].anchor[0]));
}}
else
{
continue;
}
txtFramesLen = Grps[lay_i].textFrames.length;
for (txt_i1 = txtFramesLen - 1; txt_i1 >= 0; txt_i1--) {
var text_frame = Grps[lay_i].textFrames;
if(text_frame[txt_i1].characters.length==1)
{
if(text_frame[txt_i1].contents!=text_frame[txt_i].contents)
{
if(text_frame[txt_i1].contents.match==(/[0-9]{1}$/))
{
t9 = Math.round(text_frame[txt_i1].anchor[1]);
t10 = (Math.round(text_frame[txt_i1].anchor[0]));
t11=t10-1;
var tm2= new Matrix();
tm2.mValueA = 1;
tm2.mValueB = 0;
tm2.mValueC = 0;
tm2.mValueD = 1;
tm2.mValueTX = t11;
tm2.mValueTY = t9;
text_frame[txt_i].transform(tm2,true,true,true,true,1);
}}}}}}}}}
this is my code but i could not pass t11, t9 value inside matrix