Importing Apple Notes into Evernote

Just copy and paste the following into the Script Editor and viola!

tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
set myTitle to the name of thisMessage
set myText to the body of thisMessage
set myCreateDate to the creation date of thisMessage
set myModDate to the modification date of thisMessage
tell application "Evernote"
set myNote to create note with text myTitle title myTitle notebook "Imported Notes" tags ["imported_from_notes", "TODO"]
set the HTML content of myNote to myText
set the creation date of myNote to myCreateDate
set the modification date of myNote to myCreateDate
end tell
end repeat
end tell

Source: Importing Apple Notes into EverNote | jeremyrnelson

Put your Mac to sleep via e-mail

You’re at work, with no remote control access/capability to your Mac at home, brown-outs are occurring, and you forgot to plug it into a power strip due to some unknown reason last night.  What do you do?  Well, read on…

With some preparation, you can take advantage of Apple’s Mail‘s rules feature to run an AppleScript on a filtered message next time.  Here’s how:

  1. Type this script using the Script Editor:
  2. tell application “Finder”

    display dialog “This computer will go to sleep in 1 minute.”  buttons {“Sleep”, “Cancel”} default button 2 giving up after 60

    sleep

    end tell

  3. Save the file somewhere.  I suggest Documents/Scripts (create the folder if it doesn’t exist and start saving all your useful scripts in here).
  4. Open up Apple Mail and navigate to Preferences > Rules > Add Rules.
  5. Copy and setup the following rules based on the screenshot below:
  6. Fig. 1.1 – Apple Mail’s Add Rule window

    Apple Mail rules

  7. Apply the changes and minimize Apple Mail.
  8. That’s it!  All you have to do now is send yourself an e-mail with “Sleep My Mac” as the subject with the message of “Go to sleep” from anywhere.

One caveat: For this to work, Apple Mail will need to be running (minimized is fine). 

Hopefully, you find this tip helpful and empowering.  Now back to work!  =0)