Friday, August 17, 2018

#1 2018-02-14 05:46:35 am

masoodahmad
Member
Registered: 2013-05-10
Posts: 73

Script to copy fonts to User:Library:Fonts folder

Hey,

I'm trying to update my old script, but can't figure it out. I want to copy fonts from a folder in Active window to "user/library/fonts" folder. The script is giving me error.

My script is this, can someone please help me out:

Applescript:

set userApplicationSupportFolder to path to application support folder from user domain as text
tell application "Finder"
   set theLocation to target of front window
   
   -- Copies the scripts to Desktop
   duplicate (folder "General_Scripts" of theLocation) to desktop with replacing
   
   -- Copies the PDF Preset to the Preset folder
   duplicate (every file of folder "PDF_Presets" of theLocation) to folder (userApplicationSupportFolder & "Adobe:Adobe PDF:Settings") with replacing
   
   -- Copies the Fonts to the User Fonts folder
   set myPath to (path to home folder as text) & "Library:Fonts" as alias
   duplicate (every file of folder "New Fonts" of theLocation) to folder (myPath) with replacing
   
end tell


Filed under: fonts, user library

Offline

 

#2 2018-02-14 09:19:11 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 3250

Re: Script to copy fonts to User:Library:Fonts folder

What if you move the instruction :

Applescript:

set myPath to (path to home folder as text) & "Library:Fonts" as alias

before the

Applescript:

tell application "Finder"

one.

Yvan KOENIG running High Sierra 10.13.3 in French (VALLAURIS, France) mercredi 14 février 2018 16:18:21

Offline

 

#3 2018-02-15 12:02:32 pm

Fredo d;o)
Member
From:: StÉ
Registered: 2003-02-11
Posts: 226

Re: Script to copy fonts to User:Library:Fonts folder

Hi smile

You can also use the following native path codes:

Applescript:


set system_fonts_path to path to fonts folder from system domain
set local_fonts_path to path to fonts folder from local domain
set user_fonts_path to path to fonts folder from user domain

return {system_fonts_path, local_fonts_path, user_fonts_path}

smile


Fredo d;o)
"One step at time is enough for me..." (Gandhi)

Offline

 

#4 2018-02-20 04:31:23 am

masoodahmad
Member
Registered: 2013-05-10
Posts: 73

Re: Script to copy fonts to User:Library:Fonts folder

Thanks for the suggestions. It worked. smile

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)