Copy link to clipboard
Copied
How would you go about counting the number of characters in a line?
"
The door closed slowly
There was no water
"
For example, the first line has 19 characters and the second line has 15 characters.
Copy link to clipboard
Copied
Illustrator doesn't have such a function. So unless there is a script ...
In InDesign you can do this.
Copy link to clipboard
Copied
lvoer,
You can also copy each line (or whichever amount of text) into a new word processor document and see it in the File>Properties.
Copy link to clipboard
Copied
try the script in this post
Copy link to clipboard
Copied
Hi, Carlos,
The script isn't working for me with my current configuration:
MacOS 10.14.3
Illustrator 23.0.2
Peter
Copy link to clipboard
Copied
Hi Peter, sorry about that, please download again, I fixed it.
thanks for letting me know.
Copy link to clipboard
Copied
Thanks, Carlos. I was going to send you some pristine Alaskan sunshine for one of those rare moments you might need it, but…I missed my moment.
Copy link to clipboard
Copied
my pleasure Peter, it's never too late
Copy link to clipboard
Copied
Hi Carlos,
The link for the script says it's unreachable. I just wanted to ask if it's still valid. Thanks
Dilara
Copy link to clipboard
Copied
the original post is gone for good. But here's the script from 2014
// Usage: The script targets all text in a document by default,
//
// press and hold Ctrl/Cmd before running the script to process Selected text frames only
#target Illustrator
// script.name = wordCount.jsx;
// script.description = counts words (and characters including spaces) in the active document
// script.requirements = an open document with some text
// script.parent = carlos canto // 08/27/2014
// script.elegant = false;
// Usage: The script targets all text in a document by default,
//
// press and hold Ctrl/Cmd before running the script to process Selected text frames only
function main () {
try {var idoc = app.activeDocument;}
catch (e) {alert ('open a document and try again'); return };
var tfObj=idoc.textFrames;
var wordcount = 0;
var charcount = 0;
var linecount = 0;
if(ScriptUI.environment.keyboardState.ctrlKey || ScriptUI.environment.keyboardState.metaKey) { // metaKey = cmd key on a mac
//alert('ctrl key');
var sel = idoc.selection;
tfObj = null;
tfObj = [];
for (t=0; t<sel.length; t++) {
var itext = sel[t];
if(itext.typename=="TextFrame")
tfObj.push(itext);
}
}
for (var i=0; i<tfObj.length; i++){
var tf = tfObj[i];
wordcount += tf.words.length;
charcount += tf.characters.length; // includes spaces
linecount += tf.lines.length;
}
var helpmsg = '\r\rHelp: \rScript works on all text by default, press & hold \rCtrl/Cmd before launching the script \rto count selected text frames only.';
alert('Word Count: ' + wordcount + '\rCharacter Count (including spaces): ' + charcount + '\rLine Count: ' + linecount + helpmsg);
} // end main function
main ();
Copy link to clipboard
Copied
lvoer wrote
How would you go about counting the number of characters in a line?
This would be a great feature request and it can be made here:
In InDesign you can use the Info panel and click to get a word count of the entire story or select to get a word count of the selection. I would see this working about the same way if it were implemented in Illustrator.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now