Copy link to clipboard
Copied
Hi all,
I m trying to create paragraph styles, specifying what we need? But the script runs error.
I m specifying here the font family which i need and the font style.
can anybody sort this out.
var doc = app.documents.item(0);
var paraStyleBodyText = doc.paragraphStyles.add({
name: "Ariel",
fontFamily: "Time New Roman",
fonStyle: "Roman",
pointSize: 6,
fillColor: "black25",
});
thanks,
rkids.
Copy link to clipboard
Copied
fontStyle: "Roman",
Copy link to clipboard
Copied
Thanks vamitul,
although after correction was made,
the error is; invalid parameter.
highlighting the line;
var paraStyleBodyText = doc.paragraphStyles.add({
thanks.& regards,
Copy link to clipboard
Copied
do it in two steps:
var paraStyleBodyText = doc.paragraphStyles.add();
paraStyleBodyText. name= "Ariel";
paraStyleBodyText.fontFamily= "Time New Roman";
etc etc.
Copy link to clipboard
Copied
hi Vamitul,
adding to rajnikids request, how do we add script for pointsize and fillColour to the below script you wrote:
pointSize: 6,
fillColor: "black25",
vamitul wrote:
var paraStyleBodyText = doc.paragraphStyles.add();
paraStyleBodyText. name= "Ariel";
paraStyleBodyText.fontFamily= "Time New Roman";
Copy link to clipboard
Copied
paraStyleBodyText. pointSize= 6,
paraStyleBodyText. fillColor="black25",
Copy link to clipboard
Copied
Thanks vam,
I tried the below option using your clue. All attributes creates automatically except the fontFamily "Times".
When i checked the fontfamily: it still remain in system font. Myriad pro not Times as we substituted here in script.
var doc = app.documents.item(0);
var paraStyleBodyText = doc.paragraphStyles.add({
name: "Ariel",
fontFamily: "Times",
fontStyle: "Bold",
pointSize: 6,
fillColor: "black25",
});
thanks
rkids
Copy link to clipboard
Copied
that's because there is no fontFamily..
http://jongware.mit.edu/idcs5/pc_ParagraphStyle.html
the property you are looking for is: appliedFont.
Copy link to clipboard
Copied
Thanks Vam,
One of the best clue with lot of patience in reply to the beginners.
thanks so much.