Copy link to clipboard
Copied
Hi guys, we have a suite of documents that we're changing a font on. We're changing from Applied Sans to Roboto to avoid licensing costs. Unfortunately, Roboto has ligatures and they're automatically applied to the documents when we change the fonts. These documents range between 14 and 2 pages, and they're text heavy, thus there are many ligatures thoughout. There are also a multitude of paragraph and character styles throughout all the documents and as far as we can see we can only remove all ligatures by going into each style and un-ticking it in multiple positions. We also untick a preference - Preferences - Advanced Type - Show for Character Alternates, Fractions, Ordinals and Ligatures. However, this hasn't solved the problem. This has become a time consuming process and we're looking to streamline it. I've tried multiple scripts but none have worked - I get a Java Script error. Perhaps someone can provide a 2023 script that will do the job? There isn't a work-around to using Roboto, the font choice is set in stone. Any advice on the issue would be much appreciated.
Copy link to clipboard
Copied
If you have related paragraph styles you could change it with a click in your parent style. If not, you have learned to do it better in the future.
Copy link to clipboard
Copied
There are probably all kinds of overrides in your documents, so the easiest and quickest method is probably to disable ligatures as a global local override (sounds like a contradiction in terms, but you get the picture) with this one-line script:
app.documents[0].stories.everyItem().ligatures = false;
Copy link to clipboard
Copied
Hi Peter, thank you for your response. I'm pretty green when it comes to Scripts. So far none of the ones I've created have worked. I place the text in a TextEdit doc, save it to the Scripts Panel folder, then rename it .jsx file. These haven't worked for me including that one line version you sent. Is there something I'm doing wrong?
Copy link to clipboard
Copied
How does it not work? Is the script grayed out? Are you doubleclicking it?
If it's grayed out, the script was probably saved as a RTF. Sometimes TextEdit defaults saved files to RTF. There's a setting somewhere in TE to default to plain text, which is what you want.
Copy link to clipboard
Copied
The script shows up on the panel, it just doesn't do anything. No ligatures removed.
Copy link to clipboard
Copied
Hello @defaultr7v002let17e ,
Basically what you need is a script that goes through the styles and activates/deactivates the right properties.
.
Can you upload a sample in INDD/IDML with your current styles? If so, open a document and delete the content, leaving a few paragraphs applied, and then we'll be able to help you with your exact scenario.
Copy link to clipboard
Copied
Couldn't you use the Find/Change dialog for this? I guess it depends on how many documents you're working with, but I've done this in the past myself; I'd open a hundred small documents, set up a Find/Change query with "All Documents" selected in the Search: dropdown, then just click "Change All" and walk away from the machine for a few minutes. Make sure you untick both the "Ligatures" checkbox in Basic Character Formats and the "Discretionary Ligatures" in the OpenType Features.
If that doesn't work for you, or if you are dead-set on JS: I went and found the first Google hit for "turn ligatures off in indesign with javascript" which was a thread located here, from 2009. It took me a few minutes to get it to work, but with a few minor changes, it seems to succesfully & silently turn off ligatures in all paragraph styles:
// Turn off all ligatures in all paragraph styles
// Originally posted to the Adobe User Forums by Kasyan Servetsky
// featuring Gabe Harbs suggesting "allParagraphStyles" way back in 2009
// and Joel Cherney adding a [i] in 2023
var myDoc = app.activeDocument;
var myParStyles = myDoc.allParagraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles[i].ligatures = false;
}
Copy link to clipboard
Copied
Yeah, nevermind; somehow I started writing this post hours ago, and only clicked on "Post" just now, but I think that Peter Kahrel's one-liner upthread is a far better solution. (Unless, of course, your documents are perfectly groomed with zero style overrides, in which case this one is actually what you were asking for.)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
As @brian_p_dts mentioned earlier - you've saved your script as RTF - just changing the extension won't work.
You need to use Notepad or use your current editor but make sure you are saving as a "plain text" - or ".TXT".