Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Fix Space (not in starting of line)

$
0
0

Hi All,

 

I am new to Illustrator Scripting. But I am from Indesign Backround.

 

First script in Illustrator

 

Request:


1. Need to fix the double or more space into single space.

 

2. But need to retain in the starting of line.

 

Refer the Input and Output Screenshot:

Screen Shot 2015-01-07 at 17.18.39.png

 

Trying Code:

 

Below code helps to fix space in starting of line (but that is not my request)

var myDoc = app.activeDocument;
var myTF = myDoc.textFrames;

for(i=0; i<myTF.length; i++)
{    var myLines = myTF[i].lines;    for(l=0; l<myLines.length; l++)    {    var myOutput = myLines[l].contents.replace(/\s/g, "");        myLines[l].contents = myOutput;        }    }

 

 

And, please refer good pdf or tutorials for Adobe Illustrator.

 

Thanks in advance

Siraj


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>