///////////////////////////////////////////////////////////////// //Align Ungrouped Textfields to Center (Without Shifting Text) v.1 -- CS //>=-------------------------------------- // When a user clicks the "Align" buttons on the Paragraph tab, // Illustrator shifts the text visually from it's original position. // // I wanted to be able to quickly change the paragraph alignment to center // without having to reposition the text. // // Here's the script to do it. // // At the top of the code is a list of acceptable variables to substitute if you // want to adapt the script to always justify to some other alignment than center. //>=-------------------------------------- // JS code (c) copyright: John Wundes ( john@wundes.com ) www.wundes.com //copyright full text here: http://www.wundes.com/js4ai/copyright.txt ////////////////////////////////////////////////////////////////// myJust = Justification.RIGHT; // or set to whatever you want: // Justification.CENTER // Justification.FULLJUSTIFY // Justification.FULLJUSTIFYLASTLINECENTER // Justification.FULLJUSTIFYLASTLINELEFT // Justification.FULLJUSTIFYLASTLINERIGHT // Justification.LEFT // Justification.RIGHT myTextType = TextType.POINTTEXT; // or se to whatever you want: // TextType.AREATEXT // TextType.PATHTEXT // TextType.POINTTEXT //Array for storing text x,y coordinates. locArr = new Array(); try { // Check current document for textFrames. if ( app.documents.length < 1 ) { alert ( "open a document with paragraphs that contain TabStops." ); } else { docRef = app.activeDocument; if ( docRef.textFrames.length < 1 ) { alert ( "open a document with paragraphs that contain TabStops." ); } else { sel = docRef.selection; var slen = sel.length; for (var x=0;x