• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get the missing fonts from server

Guide ,
Jan 12, 2017 Jan 12, 2017

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

TOPICS
Scripting

Views

204

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Hello Experts,

Any suggestions please

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 16, 2017 Jan 16, 2017

Copy link to clipboard

Copied

LATEST

Hello Experts,

Any suggestions please, i tried my level best but not able to finish

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines