Skip to main content
SumitKumar
Inspiring
June 10, 2017
Answered

InDesign K4(vjoon) Plug-in DOM

  • June 10, 2017
  • 3 replies
  • 2975 views

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

This topic has been closed for replies.
Correct answer Loic.Aigon

Wow that took me 2 seconds to find…

Class: Event | K4 InDesign Javascript API Documentation

3 replies

SumitKumar
Inspiring
June 12, 2017

Hi Loic,

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

Sumit

-Sumit
Loic.Aigon
Legend
June 12, 2017

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

SumitKumar
Inspiring
August 12, 2017

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.

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;

  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);

  }

}

2. Checkout articles and layout with selected files.

3. Check-in multiple files.

Could you help me?

Sumit

-Sumit
Loic.Aigon
Loic.AigonCorrect answer
Legend
June 12, 2017

Wow that took me 2 seconds to find…

Class: Event | K4 InDesign Javascript API Documentation

SumitKumar
Inspiring
June 12, 2017

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

-Sumit