5 Replies Latest reply on Aug 12, 2017 1:51 AM by Oriup

    InDesign K4(vjoon) Plug-in DOM

    Oriup Level 1

      Hello js Expert,

       

      Where I can find find Indesign External Plugin DOM?

       

      Like K4(vjoon) Plug-in DOM or In-Math (Movemen) Plug-in DOM.

       

       

       

      Kind Regards,

      Sumit

        • 2. Re: InDesign K4(vjoon) Plug-in DOM
          Oriup Level 1

          Thanks Loic,

           

          I found it day before yesterday.

           

          But I am not able to do scripting of K4 plug-in. I am familiar with jongware indesign API method.

           

           

          Sumit

          • 3. Re: InDesign K4(vjoon) Plug-in DOM
            Loic.Aigon Adobe Community Professional

            Oriup  a écrit

             

            I found it day before yesterday.

            Sumit

            Oh ok, sorry then. You should have told

            But I am not able to do scripting of K4 plug-in.

            What do you mean ? Is your script failing ? Do you lack understanding of k4 DOM ? If the latter, I guess you can't really script something if you don't get how the plugin works. Actually scripting mainly consists in mimicking manual operations.

            Feel free to give more details.

             

            Loic

            • 4. Re: InDesign K4(vjoon) Plug-in DOM
              Oriup Level 1

              Hi Loic,

               

              The problem is that I could not understand hierarchy of k4 DOM.

               

              Sumit

              • 5. Re: InDesign K4(vjoon) Plug-in DOM
                Oriup Level 1

                Hi Loic,

                 

                Yes, lack understanding of k4 DOM.

                 

                1. I want to assign articles to multiple files, I am able to do it, but not able to change user color to yellow.  Here is not mentioned color change information.

                Screen Shot 2017-08-12 at 2.11.44 PM.png

                Here is my code.

                 

                myFolder = Folder.selectDialog ("Select folder with indd...");
                if(myFolder != null){
                  batch_process (myFolder);
                }
                function batch_process (theFolder) {
                  var myFileList = theFolder.getFiles();
                  for(var i=0; i<myFileList.length; i++){
                  var myFile = myFileList[i];
                  if(myFile instanceof File && myFile.name.match(/\.indd$/i)){
                  try {
                  var doc = app.open (myFile, true);
                  }catch (e) {
                  alert("Please open in upper version...");
                  exit();
                  }
                  //insert function here
                  add_article (doc);
                  try {
                  doc.close(SaveOptions.YES);
                  }catch (e) {
                  alert("InDesign file is converted...");
                  exit();
                  }
                  }else if(myFile instanceof Folder){
                  batch_process (myFile);
                  }
                  }
                }
                
                function add_article (myDocument) {
                  var myArticleName = myDocument.name.slice(0, -5);
                  if(myDocument.k4Articles.length == 0){
                  var myArticle = myDocument.k4Articles.add({k4Name: myArticleName, articleColor: UIColors.YELLOW});
                //~ myArticle.label = UIColors.YELLOW;
                  }else {
                  alert("Already, articles created in this document...");
                  exit(0);
                  }
                  for(i=0; i<myDocument.stories.length; i++){
                  myArticle.k4AttachObjectInDocument(myDocument.stories[i]);
                
                  }
                }
                

                 

                2. Checkout articles and layout with selected files.

                3. Check-in multiple files.

                 

                Could you help me?

                 

                Sumit