Copy link to clipboard
Copied
Hi,
I need to find the missing fonts from the server and store in a folder. This is like my question regarding Get the missing links from server
Thanks Jump_Over for the script
I tried to modify you coding for fonts, but not working as expected.
var
i, j,
doc, imgs, path, cName, cFile,
imglist, searchfolder, movefolder;
for (j=0; j<app.documents.length; j++) {
doc = app.documents
; imgs = doc.fonts;
path = doc.filePath;
searchfolder = searchfolder || new Folder(path);
searchfolder = searchfolder.selectDlg(
"Find a path to "+doc.name+"'s images. Should contain "+
imgs[0].name+".*");
for (i=0; i<imgs.length; i++)
{
if (imgs.status != FontStatus.INSTALLED)
{
cName = imgs.name;
alert(cName)
imglist = findAnyFileDownThere(cName, searchfolder);
if (imglist.length == 1)
{
movefolder = Folder(path + "/Recovered Fonts");
if (!movefolder.exists) movefolder.create();
cName = imglist[0].name;
cFile = File(movefolder + "/"+ cName);
if (!cFile.exists) imglist[0].copy(cFile);
}
}
}
}
function findAnyFileDownThere (filename, path)
{
var result, folderList, fl;
result = Folder(path).getFiles (filename);
if (result.length > 0)
return result;
folderList = Folder(path).getFiles(function(item) { return item instanceof Folder && !item.hidden; });
for (fl=0; fl<folderList.length; fl++)
{
result = findAnyFileDownThere (filename, path+"/"+folderList[fl].name);
if (result.length > 0)
return result;
}
return [];
}
Please suggest where i missed.
Thanks,
K
Copy link to clipboard
Copied
Hello Experts,
Any suggestions please
Copy link to clipboard
Copied