Copy link to clipboard
Copied
Hi,
Is there a javascript to turn Ligatures off of Paragraph styles? We have a bunch of files with the ligatures turned on that we need to update. I know you can update the paragraph styles, but I was wondering if there is some way to tell InDesign to turn the Ligatures of with out updating each style.
Thanks!
Here is a simple example which turns ligatures off in all paragraph styles that are not in groups:
var myDoc = app.activeDocument;
var myParStyles = myDoc.paragraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles.ligatures = false;
}
Copy link to clipboard
Copied
Here is a simple example which turns ligatures off in all paragraph styles that are not in groups:
var myDoc = app.activeDocument;
var myParStyles = myDoc.paragraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles.ligatures = false;
}
Copy link to clipboard
Copied
Thank you so much! Will this same script work for removing hyphenation, I just need to change that line in the code?
Copy link to clipboard
Copied
var myDoc = app.activeDocument;
var myParStyles = myDoc.allParagraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles.ligatures = false;myParStyles.hyphenation = false;
}
Copy link to clipboard
Copied
Hello, I know this is a very old thread; but this is exactly what I need. We use a font that has ligatures ruining our readability and it's a corporate font. This means we need to turn off the ligatures constantly (especially when an art director has copy/pasted from Microsoft Word.) We also have a lot of old files that were done by previous art directors and so they never paid much attention to ligatures and sometimes made strange work-arounds because they were nescient of ligatures (for example they would make a space and tighten up the kerning in that space.)
Point being is that I really need a script that I can run when I open a file that looks at all text and turns off ligatures and turns off hyphenations regardless if it is part of a group or not. The script you posted looks like what I want, but since Adobe has released a few versions in the past 7 years I think something needs to be changed and outside of some html/css and BASIC about 27 years ago I am not that savvy with coding and scripts.
I would appreciate it if you or someone could update this for the current InDesign. Thank you, in advance.
Copy link to clipboard
Copied
The code still works in the latest version of InDesign -- CC 2015.4.
To turn off hyphenations (in all paragraph styles), you have to add one more line of code like so:
var myDoc = app.activeDocument;
var myParStyles = myDoc.paragraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles.ligatures = false;
myParStyles.hyphenation = false;
}
...turns off ligatures and turns off hyphenations regardless if it is part of a group or not.
The script processes all paragraph styles irrespective of whether they are in a style group or not.
Besides paragraph styles, formatting can be applied via character styles and as local formatting:
Ligatures can be set in the
hyphenation can be set in the
So, changing it in a paragraph style will have no effect, if it's overridden by a character styles or local formatting.
I think something needs to be changed and outside of some html/css
When I was writing this script, I found out that the "export tagging" feature in scripting was buggy. That's why I wasn't able to get it into shape. Though I haven't tested it in the latest version.
— Kas
Copy link to clipboard
Copied
I tried using this script and got an AppleScript error!
Error Number: -2740
Error String: A identifier can't go after this identifier
.
Engine: Default
File: {location of the script file.}
Copy link to clipboard
Copied
This is a JavaScript, not AppleScript.
Save it as 'plain text' jsx-file in your Scripts > Scripts Panel folder.
Copy link to clipboard
Copied
I saved it as a .scpt originally and I've now tried .js and .jsx and .txt
None seem to work....
Copy link to clipboard
Copied
Download the script from here.
Copy link to clipboard
Copied
Thank you very much!!!
Copy link to clipboard
Copied
Thanks Kasyan. I downloaded the script from your link and installed it on my Mac and it works.
To install on a Mac:
Download script to Desktop
Open InDesign
Go to Window > Utilities > Scripts
Right click the User Folder, choose Reveal in Finder.
Copy the Turn ligatures off.jsx file to this folder.
Return to InDesign
Turn ligatures off should appear in the User Folder list of scripts.
Select a text block with ligature characters.
Right click the Turn ligatures off script, choose Run Script
Wait a second .. it worked for me.
Copy link to clipboard
Copied
All you need to make that work with groups is change:
myDoc.paragraphStyles; to: myDoc.allParagraphStyles;
Harbs
Copy link to clipboard
Copied
This script doesn't appear to work in InDesign CC2017 on a Mac? Am I missing something?
Copy link to clipboard
Copied
Sorry .. It does work on Mac InDesign CC2017!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now