Hi, If youu want to map a style in word (Style1) to in InDesign (Style2), please follow the below steps in scripts. 1. Make Mapping input file like csv as below. 2. Read CSV file using script. readFiles(csvFile,"CSV", arr1, arr2, [], [],[0,1]); function readFiles(fileStr, fileFlag, column1, column2, columnArr){ /* @ Read File Contents from the given param file object. */ var rCnt = 0; var readFil = File(fileStr); readFil.open("r"); if(fileFlag == "TXT"){ fileContnts = readFil.read(); }else{ while(readFil.eof==false) { zRead=readFil.readln(); var csvR = zRead.split(","); if(rCnt != 0){ // To skip csv header column1.push(csvR[columnArr[0]]); column2.push(csvR[columnArr[1]]); } rCnt++; } } readFil.close(); } 3. Find word style text in InDesign and Change it to InDesign Style using FindText Preference of InDesign. for(var sCnt = 0; sCnt < arr1.length; sCnt++) { var fFontStyle = arr1[sCnt]; var cFontStyle = arr2[sCnt]; try{ // Check style existance in document and the find and replace Instead of try catch. app.findTextPreferences = null; app.changeTextPreferences = null; app.findTextPreferences.appliedParagraphStyle = fFontStyle; app.changeTextPreferences.appliedParagraphStyle = cFontStyle; var res = app.activeDocument.findText(); if(res!= null && res.length > 0) { app.activeDocument.changeText(); } app.findTextPreferences = null; app.changeTextPreferences = null; }catch(e){} }
... View more