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
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.
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Should be "NotoSans SC" - inside double quotation marks.
Copy link to clipboard
Copied
Sorry.... still getting the same error 😞
Copy link to clipboard
Copied
Can you post a screenshot of your script - in a Notepad / text editor - with hidden characters visible?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
i have the font installed:
Copy link to clipboard
Copied
Last error message should be rather clear - you forgot about the space after "Noto".
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?
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?
By @Susan Culligan
What do you mean by "descriptions"?
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.
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.
By @Susan Culligan
Can you post some screenshot(s) and mark a field(s) you're referring to?
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!!!
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.
Copy link to clipboard
Copied
Or in Package.
Copy link to clipboard
Copied
But with package you cannot redefine styles.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Check out this script.