• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text frame Transform

Explorer ,
Mar 02, 2017 Mar 02, 2017

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

TOPICS
Scripting

Views

360

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 03, 2017 Mar 03, 2017

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]];

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

can you make corrections in my code sir

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 04, 2017 Mar 04, 2017

Copy link to clipboard

Copied

LATEST

hello sir ,

still i am facing this problem !! can you help me?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 03, 2017 Mar 03, 2017

Copy link to clipboard

Copied

Thanks for the reply ,

here is my requirement

align.gif

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines