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

Add source.ttf with script

Engaged ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Hi guys good morning! What is the possibility of adding a font.ttf in the default font directory of windows with script, "C: \ Windows \ Fonts"? I tried a script to copy and paste into the fonts folder however, it doesn't work in that folder. Is there any possibility? If possible, could anyone share? Thanks

 
TOPICS
Actions and scripting

Views

213

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
Adobe
Community Expert ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Does your code work with some other folder? If so, then it might be a case of privileges for the user using which the code executes.

-Manan

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
Engaged ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

LATEST

Hi Manan Joshi , it works well with other folders.

I used it to add some fonts to the standard font folders of Adobe software at: "/ C / Program Files / Common Files / Adobe / Fonts /" ... and it works fine. My goal is to create a user interface whose elements will be icons and they will be based on a font.ttf that I am creating just for this purpose.

The problem is that in user interfaces, the font is not identified if it is not inside the standard windows font folder.

Here is the script:

 

 

var source = new Folder ("~/desktop/MyFonts/");  
var sourceFiles = source.getFiles ();  
var destination = new Folder ("/C/Program Files/Common Files/Adobe/Fonts/");  
if(!destination.exists) destination.create();  
for (var turn=0; turn<sourceFiles.length; turn++){  
    var fileName = sourceFiles[turn].name;  
    var sucess = sourceFiles[turn].copy(destination+'/'+fileName);  
}

 

 

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