Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[CS2/CS3 JS] How to set Default Font for multiple documents

Guest
Feb 11, 2009 Feb 11, 2009
Hello,

How do I set the default font for any new text frames I create.

I have several thousand InDesign templates in which the default font is set to a font that is no longer licenced and therefore requires changing.

I already have a script which will open each template and change the first insertion point of any (empty) text frame to a new font but any new text frames created in these templates still want to use the unlicensed font.

Thanks for any assistance.

Simon Kemp
TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 11, 2009 Feb 11, 2009
for existing documents:
app.activeDocument.textDefaults.appliedFont = myDoc.fonts.itemByName ('Arial\tBold');
for newly created ones:
app.textDefaults.appliedFont = myDoc.fonts.itemByName ('Arial\tBold');
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 11, 2009 Feb 11, 2009
Thanks for the reply Kasyan,

Does this work for CS2 documents?

Simon Kemp
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 11, 2009 Feb 11, 2009
>Does this work for CS2 documents?

No,CS2 doesn't support fonts.itemByName method.
I can't check it in CS2, because don't have CS2 version properly working any more.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 11, 2009 Feb 11, 2009
Thanks,

This works in CS2:

app.activeDocument.textDefaults.appliedFont = "Helvetica LT Com";

Simon
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Feb 11, 2009 Feb 11, 2009
LATEST
I made a mistake in the previous post: to set default font for application I should have used application's font collection.
app.textDefaults.appliedFont = app.fonts.itemByName ('Arial\tBold');
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines