Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Add default fonts to Notes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add default fonts to Notes
Authored by: Sesquipedalian on Aug 13, '12 10:36:35AM

This change will get overwritten on system updates, so it will probably be useful for people to have a quick script they can execute to add their preferred font back into the list. So here's one to do that.

Modify the value of myFont and mySize in the following to match your preferred font name and size, and then save it as an AppleScript wherever you like (~/Library/Scripts is a good place).

-- The user should set these values
property myFont : "Noteworthy-Light" --change this to the name of your preferred font
property mySize : 15 --change this number to your preferred font size

set plistfile to "/Applications/"

set {NotesIsRunning, NotesIsFrontmost} to {running, frontmost} of application "Notes"
if NotesIsRunning then quit application "Notes"
delay 0.5 --give the application half a second to finish quitting

set perms to (do shell script "stat -f \"%Lp\" " & quoted form of plistfile)
do shell script "chmod 777 " & quoted form of plistfile with administrator privileges

tell application "System Events" to 
if ((every property list item whose value is {FontName:myFont, |Size|:mySize}) 
in contents of property list file plistfile) is {} then 
make new property list item at end of contents of property list file plistfile 
with properties {value:{FontName:myFont, |Size|:mySize}}

do shell script "chmod " & perms & space & quoted form of plistfile  
with administrator privileges

if NotesIsRunning then launch application "Notes"
if NotesIsFrontmost then activate application "Notes"

I've built in a check so that running the script more than once won't make duplicate entries, so you can run it whenever you like to make sure Notes is set to offer your preferred default font.

EDIT: Added permissions modification to allow the user to modify the file. Only administrators will be able to do this.

Edited on Aug 13, '12 11:16:27AM by Sesquipedalian

[ Reply to This | # ]
Add default fonts to Notes
Authored by: tclementdev on Aug 28, '12 12:35:09PM

Actually this does not get overwritten on system updates (the selected default font is stored in the Notes app user preferences). So no worry :)

[ Reply to This | # ]