Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Cleaning Font Caches in OS X 10.5+
- # Sources:
- # http://www.macworld.com/article/1139383/fontcacheclear.html
- # https://www.extensis.com/support/knowledge-base/clearing-the-mac-os-x-font-cache/
- do shell script "atsutil databases -removeUser"
- try
- do shell script "sudo atsutil databases -remove" with administrator privileges
- on error errMsg number errNum
- log "Fontcache error #" & errNum & ": " & errMsg
- log "No admin privileges to execute 'atsutil databases -remove'"
- end try
- do shell script "atsutil server -shutdown"
- do shell script "atsutil server -ping"
- # Tell the user to reinitiate the login process:
- set buttonAnswer to text of button returned of (display dialog "It is strongly recommended that you restart your Mac, or at least log out and back in again." with title "Fontcaches cleaned" with icon caution buttons {"Restart", "Log out", "Later"} default button 3)
- if buttonAnswer is "Log out" then
- tell application "System Events" to log out
- else if buttonAnswer is "Restart" then
- tell application "System Events" to restart
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement