4 Replies Latest reply on Sep 17, 2013 2:32 AM by Peter Kahrel

    how to include preset in RTF import option while importing RTF files?

    virender_CTS Level 1

      Dear all,


      I created a script which will place text from rtf files present in a folder to an active document on different page based on match. I am using a preset name "myRTF" which i will use when i import rtf files without script.

      Is there a way to include this preset in script?


      I have checked many places....... but did not found.


      #target Indesign

      var myDoc = app.documents.item(0);

      var sourceFolder = Folder("/Users/admin4/Desktop/ec_txt");

      myFiles = sourceFolder.getFiles("*.rtf");


      var myFrame1 = myDoc.pageItems.itemByID(111076);  // switerland

      var myFrame2 = myDoc.pageItems.itemByID(111114);  // eurozone

      var myFrame3 = myDoc.pageItems.itemByID(111146);  // germany



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


          switch (myFiles[i].name.slice (6, myFiles[i].name.lastIndexOf("_")))


              case "Switzerland_en":

              myFrame1.parentStory.insertionPoints.item(-1).place(File (sourceFolder + "/" + myFiles[i].name))



              case "Eurozone_en":

              myFrame2.parentStory.insertionPoints.item(-1).place(File (sourceFolder + "/" + myFiles[i].name))



              case "Germany_en":

              myFrame3.parentStory.insertionPoints.item(-1).place(File (sourceFolder + "/" + myFiles[i].name))