Skip to main content
Participant
August 13, 2009
Question

newbie: is there a script to randomly adjust size of words in a text area?

  • August 13, 2009
  • 1 reply
  • 645 views

alternatively a relatively quick way of doing it (I have tried to do it manually but it takes forever and ever and ever, and my eyes hurt).

This topic has been closed for replies.

1 reply

August 17, 2009

Here's a little Javascript which should work in most instances. You need to select the text frame and then run the script.

if (app.selection.length == 1) { //tests to see that you have selected one page item

if (app.selection[0].constructor == TextFrame) { //ensures you have selected a text frame

var wrds = app.selection[0].words;

for (i=wrds.length-1;i>=0;i--) { // loops through words in frame

wrds.characterAttributes.size = Math.floor((Math.random()*19)+6); //adjusts point size of words

}

}

}

The minimum word size is the 6 in the fifth line and the maximum should be 24 (19-1+6).

Cheers,

Bay