Get Mac clipboard contents into Drafts using Hazel


Just saw this cool tip by Greg Pierce of Agile Tortoise that allows you to get the clipboard contents of your mac into Drafts using Keyboard Maestro. I don’t have KM but I do have Hazel, so I’ve thrown together something (along the same lines as this tip from David Sparks) that allows you to accomplish the same thing using Hazel.

The good thing about this is that you don’t even have to leave Drafts to make it work. You could also invoke the Applescript via a key command if you want, though.

1. The Hazel Rule

This is a rule that watches for a file called “mbclip.txt” in the default Drafts directory.

Here’s the Hazel Rule:

Here’s the Applescript inside it:

<code>set theText to the clipboard as text
if theText is equal to "" then
    do shell script "aflplay /System/Library/SOunds/Funk.aiff"
    return
end if
tell application "Reminders"
    set theList to list "Drafts"
    tell theList
        make new reminder with properties {name:theText}
    end tell
    do shell script "afplay /System/Library/Sounds/Glass.aiff"
end tell
</code>

You can download the rule from here and import it into Hazel.

2. The Drafts Action

You’ll need to make sure that your Drafts is set up to import from the Reminders list “Drafts”. You’ll also need to make sure that the “Drafts” list exists, and that both your Mac and your iOS device are syncing Reminders over iCloud.

The Drafts action creates a file called whatever the first line of your Draft was. So in this case you want to type “mbclip” and then invoke the Action.

Import the Drafts action by tapping here

Once iCloud gets its pants on and manages to sync Reminders lists, you’re golden.