Skip to main content
March 4, 2011
Answered

Change language & hypenation toggle scripts

  • March 4, 2011
  • 1 reply
  • 1511 views

Hi all,

I'm after two scripts:

1. To be able to toggle hypenation ON and OFF in the whole document (including character and paragraph styles)

2. To be able to change the language of the whole document globally (e.g. from German to English, English to Italian etc etc...)

It would be great if these scripts could be both PC and Apple MAC compatiable. I'm guessing it would have to be coded in Java Script and VB Script?

Thanks

This topic has been closed for replies.
Correct answer Loic.Aigon

Ok thak you very much!

Just a question, i ws under the impression the mac scripts use VB script? Is this not the case and whats the difference between java script and VB script? Sorry i'm a newbie at this!


have a look here where a lot of things are told for rookies http://www.stevewareham.com/adobe_scripting.php

1 reply

Loic.Aigon
Legend
March 4, 2011

Maybe give this a try :

http://www.scriptopedia.org/index.php?post/switchLanguageV2.html

For hyphenations ON/OFF I am quite sure I did sth like this.

Loic

Loic.Aigon
Legend
March 4, 2011

Here it is. Defaullt Paragraph Style can't be modified.

Application.prototype.main=function()
{
    if(this.documents.length>0)
    {
        var doc= this.activeDocument;
        //Enlever toutes césures dans le document actif
        doc.stories.everyItem().hyphenation=false;
        //Redéfinir les styles sans les césures.
        //Le style Paragraphe standard ne semble pas pouvoir être modifié via scripting
        var paraSt = doc.paragraphStyles.everyItem().getElements();
        for(var i=0; i<paraSt.length; i++)
        {
            if(paraSt.name.indexOf("[")==-1)
            {
                paraSt.hyphenation=false;
            }
        }
    }
}
app.main();

Loic

PS: it's an old script so forgive the indexOf checking

March 4, 2011

Thats great thanks,

will this script work on a apple mac indesign?

Also what about the change language script, any ideas?