Skip to main content
Known Participant
October 21, 2009
Answered

Bold Text

  • October 21, 2009
  • 1 reply
  • 1791 views

Hello

I am trying to embolden some text which I am adding via a script to a document.

For example:

This is really great.

Is the any way I can 'Tag' text so Indesign will embolden this?

..or would I have to create my own tagging system ....This is <bold>really</bold> fun   ...?

any ideas would be much appreciated. If it's the latter and someone had an example of how, I would really appreciate it.

Thanks

Coully

This topic has been closed for replies.
Correct answer Techi_Panda

Hi coully

you can try this, this works in CS3

create bold CharacterStyle

var myTextFrame = app.selection[0];
var myStory = myTextFrame.parentStory;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "<bold>([A-z]*)<\/bold>";
app.changeGrepPreferences.changeTo = "$1";
app.changeGrepPreferences.appliedCharacterStyle = 'bold';
myStory.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;

thanks

regards

a r u l

1 reply

Techi_Panda
Techi_PandaCorrect answer
Inspiring
October 21, 2009

Hi coully

you can try this, this works in CS3

create bold CharacterStyle

var myTextFrame = app.selection[0];
var myStory = myTextFrame.parentStory;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "<bold>([A-z]*)<\/bold>";
app.changeGrepPreferences.changeTo = "$1";
app.changeGrepPreferences.appliedCharacterStyle = 'bold';
myStory.changeGrep();
app.findGrepPreferences = app.changeGrepPreferences = null;

thanks

regards

a r u l

CoullyAuthor
Known Participant
October 21, 2009

Brilliant cheers arul.

CoullyAuthor
Known Participant
October 22, 2009

Found a weird one to do with this as well.

If the text overflows it only seems to find the bold tags in the first line of the textframe / story. Possibly an Indesign bug? or is this intentional.

I've tried switching all the FindChangeGrepOptions - Includes to true to no avail.

any ideas?