Skip to main content
Inspiring
February 22, 2017
Answered

Having Trouble getting this box to Rotate.

  • February 22, 2017
  • 1 reply
  • 338 views

I have having trouble getting this text box to rotate.

     function addTextF(doc, layer, name){ 

app.generalPreferences.preventSelectingLockedItems= false;

        var myBlendingSettings = { blendMode : BlendMode.NORMAL };       

        var myTransparencySettings = { blendingSettings : myBlendingSettings };    

         

        var tF = doc.textFrames.itemByName(name); 

        if(tF && tF.isValid) {       

tF.remove(); 

        } 

        var origUnit = app.scriptPreferences.measurementUnit; 

       

app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;

    tF = doc.textFrames.add(layer, LocationOptions.UNKNOWN, {name: name, fillColor :"Paper", fillTint: 100, transparencySettings : myTransparencySettings, geometricBounds: ['.504in','.21in','.376in','-.21in'] });

tF.flipItem(Flip.HORIZONTAL,AnchorPoint.CENTER_ANCHOR);           

tF.locked=true;

app.scriptPreferences.measurementUnit = origUnit;     

              return tF; 

    }

FROM THIS

TO THIS

This topic has been closed for replies.
Correct answer Marc Autret

Depending on whether tF.flipItem(…) is applied, or not, before the rotation, try either

  • tF.rotationAngle += 90;

or

  • tF.rotationAngle -= 90;

@+

Marc

1 reply

Marc Autret
Marc AutretCorrect answer
Legend
February 23, 2017

Depending on whether tF.flipItem(…) is applied, or not, before the rotation, try either

  • tF.rotationAngle += 90;

or

  • tF.rotationAngle -= 90;

@+

Marc

cbishop01Author
Inspiring
February 23, 2017

thank you thank you thank you.  i was trying that flip.VERTICAL and all other variants of that.