Jump to content

grumpyclam

Level 1
  • Posts

    4
  • Joined

  • Last visited

Posts posted by grumpyclam

  1. Hello. First time posting.

    So I have been teaching myself web design & development, and using Evernote to keep notes on various languages and frameworks. These notes have, of course, code snippets, mostly that I copy in or type out by hand (for example, as I watch a video on Code School). These are interspersed with my explanations and comments. So I am typing my note in the default font, Helvetica Neue, and then going back through and changing the code snippets to Courier New. I know I can go and put my snippets into some code formatter web app and paste them back in, but for my purposes all I really want is for snippets to be a different font. And I want to avoid the hassle of selecting the snippet and going through the font dropdown every time.

    I was wondering if there was a way to do this. I have been fiddling with AppleScript, trying to make a Service that I could then bind to a keyboard shortcut, but Evernote doesn't seem to allow access to the actual content of notes from AppleScript. Right now I'm trying to save the note HTML content to a variable and then add a font tag to lines that start with a certain character, but I was just introduced to AppleScript today so I don't really know what I'm doing.

    Here's the lame attempt I have so far:

    property noteHtml : ""
    property addOn : "<br><br><hr><br><br>"
    
    tell application "Evernote"
    	activate
    	set note1 to selection
    	set noteHtml to (HTML content of note1)
    	set addString to "<br>"
    	if {noteHtml starts with "<p>"} then
    		set editHtml to ?
    		set noteHtml to editHtml
    	end if
    end tell

    Can anyone offer any tips or a solution? Thanks.

×
×
  • Create New...