Collect used document fonts and export them to folder
Hello all!
I am needing a little bit of help with a script I am using to collect a
documents fonts. It is all working fine, except I don't like how it is
naming the folder it creates. I want the folder name to be simply "Document
fonts" and not include the InDesign file name. I would like the folder to be
in the same directory as the Indesign file. Would somebody be so kind as to
show me what I need to change in my code? I have the code I am using below.
If anything isn't clear enough, let me know.
var
myFonts = app.documents[0].fonts.everyItem().getElements(),
myDocument = app.activeDocument,
len = myFonts.length,
cFile, cName, outFile, i,
movefolder = myDocument.fullName + "Document fonts"
movefolder = Folder(movefolder);
if (!movefolder.exists) movefolder.create();
for(i=0;i<len;i++) {
cFile = File(myFonts.location);
if(!cFile.exists) continue;
cName = cFile.name;
outFile = File(movefolder + "/"+ cName);
cFile.copy(outFile);
}
Thanks in advance for your help!
Awitmer
