Created
October 2, 2022 19:23
-
-
Save dulldesk/2bf7168eb4fd4624dbba0c8893c9aab4 to your computer and use it in GitHub Desktop.
Adobe Illustrator script to count the number of words in the document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@target illustrator | |
// app.preferences.setBooleanPreference('ShowExternalJSXWarning', false); | |
const app_dir = app.activeDocument.path; | |
function main() { | |
if (!documents.length) { | |
alert('Error\nOpen a document and try again'); | |
return; | |
} | |
var textRefs = app.activeDocument.textFrames; | |
var cnt = 0; | |
for (var i=0; i<textRefs.length; i++) { | |
cnt += textRefs[i].contents.split(" ").length; | |
} | |
alert("Count: " + cnt); | |
} | |
main(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment