Copy link to clipboard
Copied
I found two great expressions on the web, one for random words (based on words in the layer name), and another for random fonts (from a font list in the expression.) They both work great on their own, but when I stack them together only the lower one works. I know this is a common problem but I can't figure it out. I see other posts with solutions to similar non-text scripts, but I can't figure how to apply those solutions to this. Thank you for any assistance you can give. I would love to be able to apply both of these to on text layer!
Here're the scripts (there's a frame rate slider associated with the random word script, but I'm not sure how to include that:
//random words
words=thisLayer.name.split(" ");
wordCount=words.length;
frameRate=effect("Frame Rate")("Slider");
seedRandom(Math.floor(time*frameRate), timeless = true)
randomNumber=random(0,wordCount);
roundedNumber=Math.floor(randomNumber);
words[roundedNumber]
// random fonts
var array = [ "Courier-Bold", "Copperplate-Bold", "Compacta-Normal", "Citore", "Cochin", "Izzard", ];
hold=0.2;
seed=Math.round(random(time/hold));
seedRandom(seed,true);
r=Math.round(random(53));
style.setFont(array[r])
words=thisLayer.name.split(" ");
wordCount=words.length; frameRate=effect("Frame Rate")("Slider");
seedRandom(Math.floor(time*frameRate), timeless = true)
randomNumber=random(0,wordCount);
roundedNumber=Math.floor(randomNumber);
words[roundedNumber]
Copy link to clipboard
Copied
The expressions need to be used on different layers with one feeding in the random words into the other's source text.
Mylenium
Copy link to clipboard
Copied
Thank you! I will try that.
Copy link to clipboard
Copied
It's still over-riding the change font script. I am using the pickwhip, should I not?
Copy link to clipboard
Copied
Perhaps an issue with parsing the font names? Have you tried to debug it by inserting a font name directly into the setStyle()?
Mylenium