Copy link to clipboard
Copied
How do I make the numbers inside the textbox All Caps() instead of the letters.
Working code:
txt = thisLayer.text.sourceText;
hasNumbers = /\d/.test(txt);
if (hasNumbers) {
txt.toUpperCase();
} else {
txt;
}
Thanks
Copy link to clipboard
Copied
Your code doesn't make much sense. You're not actually invoking a string substitution with .replace() anywhere. You're just testing a regular expression for true or false. Either uesregex.replace() on your numerals or funnel the captured regex filter through a JS replace. additionally you will of course need to deal with the rest of the string and slice & dice it, then re-assemble with the changed numbers.
Mylenium
Copy link to clipboard
Copied
Thanks Mylenium, Im kinda new to this so im just using what I can find online. can you teach me how to write this?
Copy link to clipboard
Copied
txt = thisLayer.text.sourceText;
hasNumbers = /\d/.test(txt);
if (hasNumbers) {
hasNumbers.uesregex.replace();
} else {
txt;
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now