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

Change font family only via a script

Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Hi 

Is there a way to a launch a script to automatic change all the paragraph styles in a file from one font family to another. 

I'd like to: open a indesign file, open scripts, click a script, choose a font family i want to change to (or have one assigned), then done? 

I dont want to change the font (i.e. bold, regualr, semi, etc), i only want the family to change. I can do this manually style by style but its a long process. I found this is the default change when i try to use the find and replace formatting option in indesign. 
For example i have english files in one font (Inter) and we have translations made for me but they require to to be in (Noto Sans SC) for Chinese. 

Thanks

TOPICS
How to , Import and export , Scripting , Type

Views

198

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

I'm on my phone but hopefully it will work: 

 

app.activeDocument.paragraphStyles.everyItem().appliedFont = "name of your font";

 

 

It won't change Styles in subfolders - you can try and change it to allParagraphStyles. 

 

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Thanks, i have no experience writing scripts? Are you able to share a file so i can add to indesign or send an example how i can save the file locally. 

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Thanks on the upload scripts "how to". was able to add. Bookmarked for next time. 

I receive:

Error number 25?

Error String: Expected: ;

Engine: main

File: location- shows file path

Line: 1

Source: app.activeDocument.paragraphStyles.everyItem().appliedFont = NotoSans SC;

Offending Text: Sans

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Should be "NotoSans SC" - inside double quotation marks. 

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Sorry.... still getting the same error 😞 

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Can you post a screenshot of your script - in a Notepad / text editor - with hidden characters visible? 

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

martinj54220288_0-1736178362336.png

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

martinj54220288_0-1736178440445.png

 

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

i have the font installed: 

martinj54220288_0-1736178568317.png

 

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Last error message should be rather clear - you forgot about the space after "Noto". 

 

Votes

Translate

Translate

Report

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
Contributor ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Wow, Robert, I can certainly use this too. Will this change the fonts in the Paragraph Styles descriptions as well, or is that too much to hope for?

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

quote

Wow, Robert, I can certainly use this too. Will this change the fonts in the Paragraph Styles descriptions as well, or is that too much to hope for?


By @Susan Culligan

 

What do you mean by "descriptions"?

 

Votes

Translate

Translate

Report

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
Contributor ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Where you set up the Paragraph Styles. Maybe I'm using the wrong term, but the "helpful boxes" (as my ex used to call them) where you set up font, spacing, etc.

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

quote

Where you set up the Paragraph Styles. Maybe I'm using the wrong term, but the "helpful boxes" (as my ex used to call them) where you set up font, spacing, etc.


By @Susan Culligan

 

Can you post some screenshot(s) and mark a field(s) you're referring to? 

 

Votes

Translate

Translate

Report

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
Contributor ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

I see the screenshot where you check the box "Redefine style when changing all." That's exactly whe I needed.

 

Thanks!!!

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Wi6thout a scrip you can use the command

Type > Dind / Replace Fonts …

Activate the option to redefine styles

 

I tthink it is better than a script as you see really all used fonts.

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

Or in Package.

 

RobertatIDTasker_0-1736207782629.png

 

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

But with package you cannot redefine styles. 

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 06, 2025 Jan 06, 2025

Copy link to clipboard

Copied

quote

But with package you cannot redefine styles. 


By @Willi Adelberger

 

My screenshot says otherwise? 

 

Votes

Translate

Translate

Report

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
Guru ,
Jan 07, 2025 Jan 07, 2025

Copy link to clipboard

Copied

LATEST

Check out this script.

Votes

Translate

Translate

Report

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