• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

the answer to the options under each question that matches the character style.

Participant ,
Mar 07, 2017 Mar 07, 2017

Copy link to clipboard

Copied

I have a long document. I want to find the answer to the options under each question that matches the character style. Do you have any idea? Thanks in advance.

1.jpg2.jpg

TOPICS
Scripting

Views

261

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2017 Mar 08, 2017

Copy link to clipboard

Copied

Interesting game! …

(^/) 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 12, 2017 Mar 12, 2017

Copy link to clipboard

Copied

LATEST

Try this code.

#target indesign

var myDoc =app.activeDocument;

var myarray =[];

var myarray_1 = [];

var my_Final = [];

app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = "^\\d";

myFound = myDoc.findGrep();

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

{

    if(myFound.contents)

    {

    myarray.push(myFound.contents);

    var myjoin = myarray.join("")

   }

  }

app.findGrepPreferences = null;

app.findGrepPreferences.appliedCharacterStyle = "Blue";

myFound_1 = myDoc.findGrep();

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

{

    if(myFound_1.contents)

    {

    myarray_1.push(myFound_1.contents);

    var myjoin_1 = myarray_1.join("")

  }

   }

for(a=0; a<myjoin.length&&myjoin_1.length; a++)

{

var my_Final$ =myjoin+myjoin_1;

my_Final.push(my_Final$)

var final_join = my_Final.join("\n")

}

var myFile_path = app.activeDocument.filePath;

var myReport_name = myDoc.name.replace(".indd", ".csv");

var myFinalpath = myFile_path+ "/"+myReport_name;

var myTextFile = new File(myFile_path+"/"+myReport_name)

myTextFile.open("w");

myTextFile.write(final_join)

myTextFile.close();

Thanks,
Prabu
Design smarter, faster, and bolder with InDesign scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines