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


Click here to return to the '10.8: New Notes App Service' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.8: New Notes App Service
Authored by: thawk9455 on Apr 13, '13 07:59:26PM
I took a little of each of the suggestions above. I didn't activate Notes since I might not want to leave the application I'm in. I did have a default account set so that code works for me. I also was able to get the HTML conversion to set the font size but the font portion doesn't seem to be working. I'd love to hear a way to fix that cleanly...

on run {input, parameters}
	set noteText to do shell script "echo " & quoted form of (input as text) & 
		" | /usr/bin/textutil -stdin -stdout -fontsize 15 -font \"Noteworthy Light\" -convert html"
	tell application "Notes"
		tell account id (do shell script "defaults read -app Notes DefaultAccount")
			if not (exists folder "Notes") then make new folder with properties {name:"Notes"}
			tell folder "Notes"
				make new note with properties {body:noteText}
			end tell
		end tell
	end tell
	tell application "System Events" to tell process "Notes"
		set selected of row 1 of table 1 of scroll area 1 of group 1 of splitter group 1 of window 1 to true
		set focused of group 1 of UI element 1 of scroll area 1 of group 2 of splitter group 1 of window 1 to true
	end tell
end run
Edited on Apr 13, '13 08:05:11PM by thawk9455


[ Reply to This | # ]