Copy link to clipboard
Copied
Hi,
Could any one convert my js code into java code?
Thanks in advance!!!
var ePubFontFolder = Folder("~/Desktop/myEpub");
var myFontFolder = Folder("~/Font_Collection");
show_dialog ();
alert("Done!");
function copy_fonts (ePubFontFolder) {
var myFontList = ePubFontFolder.getFiles();
for(var i=0; i<myFontList.length; i++) {
var myFont = myFontList;
if(myFont instanceof File && myFont.hidden != true && myFont.name.match(/\.([ot]tf|dfont)/g)) {
var myFontName = myFont.name.replace(/\.([ot]tf|dfont)/g, ".otf");
var myFontFile = File(myFontFolder + "/" + myFontName.split(/[-.]/g)[0] + "/" + myFontName);
if(myFontFile.exists){
myFont.remove();
myFontFile.copy (Folder(myFont.parent + "/" + myFontName));
} else {
alert(myFont + ":\r Not found...");
}
} else if (myFont instanceof Folder){
copy_fonts (myFont);
}
}
}
Regards,
Sumit
Hi Sumit,
The code pretty much remains the same, the main part is making JAVA talk to InDesign application. On Windows you would need a library that can load COM objects for you and then you can translate your code, that would be pretty straightforward. Have a look at the following discussion to get a start
Manipulate Indesign cliente from a Java Application
-Manan
Copy link to clipboard
Copied
Hi Sumit,
The code pretty much remains the same, the main part is making JAVA talk to InDesign application. On Windows you would need a library that can load COM objects for you and then you can translate your code, that would be pretty straightforward. Have a look at the following discussion to get a start
Manipulate Indesign cliente from a Java Application
-Manan