Skip to main content
karthikS
Inspiring
April 26, 2016
Answered

How to find different languages of a indd Document?

  • April 26, 2016
  • 2 replies
  • 650 views

Dear Friends,

I am using multi language books. How to find the language in the following list (Just i want to find option only).

  1. English: UK
  2. German: Old Rules

This is possible to find/replace option. Please suggest friend

Advance thanks

This topic has been closed for replies.
Correct answer b91823603

Hi Karthik,

Try this,

app.findTextPreferences = null;

app.findTextPreferences.appliedLanguage = "English: UK";

var ukText = app.activeDocument.findText();

app.findTextPreferences = null;

for(var i=0;i<ukText.length;i++)

    $.writeln(ukText.contents);

app.findTextPreferences.appliedLanguage = "German: Old Rules";

var gerText = app.activeDocument.findText();

app.findTextPreferences = null;

for(var j=0;j<gerText.length;j++)

    $.writeln(gerText.contents);

2 replies

b91823603
b91823603Correct answer
Participating Frequently
April 26, 2016

Hi Karthik,

Try this,

app.findTextPreferences = null;

app.findTextPreferences.appliedLanguage = "English: UK";

var ukText = app.activeDocument.findText();

app.findTextPreferences = null;

for(var i=0;i<ukText.length;i++)

    $.writeln(ukText.contents);

app.findTextPreferences.appliedLanguage = "German: Old Rules";

var gerText = app.activeDocument.findText();

app.findTextPreferences = null;

for(var j=0;j<gerText.length;j++)

    $.writeln(gerText.contents);

tpk1982
Legend
April 26, 2016

Karthik, if you need to know whether this two 2 language present then use this.. i just modified b91823603 script

app.findTextPreferences = null;

app.findTextPreferences.appliedLanguage = "English: UK";

var ukText = app.activeDocument.findText();

app.findTextPreferences = null;

if(ukText.length>0){

     alert("Found English: UK applied texts in the document");

    }

else

{

    alert("No English: UK used in the document");

    }

app.findTextPreferences.appliedLanguage = "German: Old Rules";

var gerText = app.activeDocument.findText();

app.findTextPreferences = null;

if(gerText.length>0){

   alert("Found German: Old Rules applied texts in the document");

    }

else

{

    alert("No German: Old Rules used in the document");

    }

karthikS
karthikSAuthor
Inspiring
April 26, 2016

Hi B and TPK

Your bath script working good and super.

Thank you so mach my dear friends,

Thanks

Jongware
Community Expert
Community Expert
April 26, 2016

Uh, "yes"? As in, "yes it is possible to find"? What made you think it is not possible?

karthikS
karthikSAuthor
Inspiring
April 26, 2016

Hi Jongware,

Thanks your replay

I have newly leaning for java script. I have find the adobe forums but i am not got any one answer. That only i am asking this question?

Please give suggest

Thanks