Here’s an applescript that I’m going to use for taking notes on my laptop in school.
set this_moment to (the current date)
set the_weekday to ((weekday of date (date string of (the current date))) as string)
set the_month to ((month of date (date string of (the current date))) as string)
set the_year to ((year of date (date string of (the current date))) as string)
set the_day to ((day of date (date string of (the current date))) as string)
tell application "TextEdit"
make new document
set {text of document 1, font of document 1, size of document 1} to {the_weekday & ", " & the_month & " " & the_day & ", " & the_year & return & " Solomon Freilich" & return & " <teacher's name (I make a script specific to each)>" & return & " <Science/subject that that teacher teaches>" & return & return, "Helvetica", "39.5"}
set bounds of window 1 to {0, 22, 1280, 796}
end tell
The above script snippet works fine.
I sometimes use html for notes and I like that when editing html in dashcode, you can press enter for a new a line & the browser will understand when your done as you’ll open it in your browser (I use Camino for html docs) and your line breaks will be there (unlike in TextEdit) where I find I have to write
, which gets tedious (as well as not visually easy while reading from the code, unless you press return too”which is just another keypress.
So I was thinking, "Great! I’ll replace the word ‘TextEdit’ with the word ‘Dashcode’ and replace the word ‘text’ with the word ‘rich text’ and all work the same (except in Dashcode instead of in TextEdit).
But it didn’t: Apple Event handler got an error of some kind & it seemed to be related to the ‘make new document’ part of the script. I compared TextEdit’s and Dashcode’s dictionaries & they are too similar for this thing to be happening.
Model: MacBook
Browser: Firefox 3.0.1
Operating System: Mac OS X (10.5)