Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Changing text and keeping the font style the same

$
0
0

Using Illustrator cs 5 / JavaScript

 

I'm having a problem with keeping text styles like bold and Regular(not bold) from change.

here is the problem

say you want to change text like

Scripting is not fun! to Scripting is fun!

no problem...

var docRef = app.activeDocument;

var textRef1 = docRef.textFrames[0];

textRef1.contents = "Scripting is fun!";

 

but what if that text is like this

 

Scripting is not fun! (with "Scripting" bold and the rest regular)

when you run the same script it makes all the text bold

Scripting is not fun! = Scripting is fun!

or if "Scripting" is regular and the rest is bold it will turn all of it regular.

Scripting is not fun! = Scripting is fun!


How would we keep the styles from changing?

any help would be appreciated.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>