Seeking Script to Turn Off All Ligatures and Hyphenations
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Seeking Script to Turn Off All Ligatures and Hyphenations
- This topic has 8 replies, 4 voices, and was last updated 7 years, 3 months ago by David Blatner.
-
AuthorPosts
-
-
October 18, 2016 at 10:22 am #89115Sean CarterMember
So, I’m at a dead end. Quick background: we have a font that has ligatures which we want turned off and previous art directors were not diligent in turning off hyphenations or ligatures and as I have to reuse some of those files or archive old files I would LOVE to have an InDesign script to turn off all ligatures and hyphenations in the document (regardless if they are a part of a group or not.)
I found this thread on Adobe:
But, it’s from 2009 and so I don’t know if I’ll get a response as I have set a reply in there as well, but since the many talented folk in this forum have been very helpful for the past decade I thought I’d post in here as well.
So, if anyone knows how to get that script to work or knows a script that will work, I’d appreciate some help. Thank you in advance.
-
October 18, 2016 at 10:49 am #89116David BlatnerKeymaster
I’m assuming you’re not using paragraph and character styles? That would help a lot in this situation.
You could also use the Find/Change dialog box to change those, no? (Not saying a script isn’t a good idea, but…) -
October 18, 2016 at 11:32 am #89119Sean CarterMember
Thanks David,
Yeah most of our work doesn’t need styles and so we generally don’t waste our time with those (except for a different client for whom we do catalogues for and so it’s beneficial in that one.)
I did find out elsewhere today in this search about the find/change and that was news to me. I never knew you could change styles and such with that feature.
-
October 18, 2016 at 10:40 pm #89135Gert VerreptMember
as far as ligatures are concerned:
var myDoc = app.activeDocument;
var myParStyles = myDoc.allParagraphStyles;
for (i = 1; i < myParStyles.length; i++) {
myParStyles[i].ligatures = false;
myParStyles[i].hyphenation = false;
} -
October 19, 2016 at 11:50 am #89163Sean CarterMember
Thanks Gert, but that looks like the script that was referenced in my link — and it wasn’t working for me.
There has been a reply in the original link I posted that is working just fine. For anyone else who might need it as well:
Save the following as “Turn ligatures off.jsx”
var scriptName = “Turn ligatures off”,
doc;PreCheck();
//===================================== FUNCTIONS ======================================
function Main() {
var allParStyles = doc.paragraphStyles;for (i = 1; i < allParStyles.length; i++) {
allParStyles[i].ligatures = false;
allParStyles[i].hyphenation = false;
}
}
//——————————————————————————————————————————————————–
function PreCheck() {
if (app.documents.length == 0) ErrorExit(“Please open a document and try again.”, true);
doc = app.activeDocument;
if (doc.converted) ErrorExit(“The current document has been modified by being converted from older version of InDesign. Please save the document and try again.”, true);
if (!doc.saved) ErrorExit(“The current document has not been saved since it was created. Please save the document and try again.”, true);
Main();
}
//——————————————————————————————————————————————————–
function ErrorExit(error, icon) {
alert(error, scriptName, icon);
exit();
}
//——————————————————————————————————————————————————– -
January 5, 2017 at 12:37 am #91009Annie AndersonMember
Hi Sean Carter,
Where do I save this script?
I did save it here but it still have ligatures turned on when open indd. document.C:\Program Files\Adobe\Adobe InDesign CC 2015\Scripts\Scripts Panel\Samples\JavaScript
Thanks in advance.
Br Annie
-
January 5, 2017 at 2:37 am #91010Gert VerreptMember
Annie, you didn’t say if you have executed the script, did you? Save script with the extension .jsx in the above folder, open doc and execute the script by double clicking on it.
-
January 5, 2017 at 6:50 am #91015Annie AndersonMember
Hi Gert,
Yes I did execute the .jsx script and when I open .indd document it still has ligatures on.
-
January 5, 2017 at 10:01 am #91020David BlatnerKeymaster
Here’s how to install scripts you found in a forum: https://creativepro.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php
-
-
AuthorPosts
- You must be logged in to reply to this topic.