0
Engaged
,
/t5/indesign-discussions/how-to-apply-bold-to-string-which-is-created-from-javascript-in-a-document/td-p/13260041
Oct 11, 2022
Oct 11, 2022
Copy link to clipboard
Copied
var imgName = "img1.tif";
myTable.columns[0].cells[0].contents = "Figure Name: " + imgName;
In the above code, I need to apply Bold to "Figure Name: " alone.
Is there any way to do this?
TOPICS
How to
,
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Community Expert
,
Oct 11, 2022
Oct 11, 2022
Hi @Karthik SG , Try this—it assumes the font has a "Bold" fontStyle
var imgName = "img1.tif";
var myTable = app.activeDocument.stories[0].tables[0];
myTable.columns[0].cells[0].contents = "Figure Name: " + imgName;
myTable.columns[0].cells[0].words.itemByRange(0,1).fontStyle = "Bold"
Community Expert
,
/t5/indesign-discussions/how-to-apply-bold-to-string-which-is-created-from-javascript-in-a-document/m-p/13260194#M496660
Oct 11, 2022
Oct 11, 2022
Copy link to clipboard
Copied
Hi @Karthik SG , Try this—it assumes the font has a "Bold" fontStyle
var imgName = "img1.tif";
var myTable = app.activeDocument.stories[0].tables[0];
myTable.columns[0].cells[0].contents = "Figure Name: " + imgName;
myTable.columns[0].cells[0].words.itemByRange(0,1).fontStyle = "Bold"
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Karthik SG
AUTHOR
Engaged
,
LATEST
/t5/indesign-discussions/how-to-apply-bold-to-string-which-is-created-from-javascript-in-a-document/m-p/13261496#M496724
Oct 11, 2022
Oct 11, 2022
Copy link to clipboard
Copied
Thank you @rob day , it is working!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

