Skip to main content
Question

Removing multiple fonts at once via scripting

  • June 18, 2018
  • 1 reply
  • 0 views

Forum|alt.badge.img+2

I've been trying to figure this out but I am no scripting guru so I'll just explain the goal and hope someone knows alot more than me!

We've gotten a request to remove literally 200+ fonts from every system in 3 different labs. I am trying to write a script to do this but am running into alot of roadblocks.

First I am writing this in Apple Script editor...using the following commands for each font:
do shell script "rm /library/fonts/fontname*"
This runs into an error if that font doesn't exist and the script stops there, i've tried to add 2> /dev/null to the end of that line but then it says there's an unexpected end of line but found number.. Any help is appreciated, thanks!

1 reply

Forum|alt.badge.img+26
  • Valued Contributor
  • 907 replies
  • June 18, 2018

One way you could do this easier in my opinion is to set up a perfect machine how you want it and capture the various font folders from it and package them up. After they have been packaged up, go to the machine in question and blow away the contents of ALL fonts from those fonts folders and replace with your new package.

Not the best method, but much easier to script and you will literally have blessed everything that goes into it. When doing this, leave everything in /System/Library/Fonts alone of course, but you should be able to empty the contents of the /Users/<username>/Library/Fonts and /Library/Fonts and build it with known good copies of the fonts you wish to make available to your users.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings