This just creates a new note in notes.app. To keep it simple, it just uses the first folder in the first account it finds. You can change this behaviour by editing providing the respective names in the "properties" in the applescript.
Usage
To search existing notes, type "n search_term" into Alfred. E.g. "n something I wrote yesterday" (not working in macOS High Sierra)
To create a new note, just type "n note_text" into Alfred. E.g. "n something very important I will probably forget"
To create a note from the clipboard, type "nclip optional_note_name"
Hold option to open the note in a new window after creating it.
iCloud Notes on OS 10.11+
As of Mac OS El Capitan, you are given the option to upgrade iCloud notes accounts. Once you do this, with the normal Notes workflow you'll start seeing duplicate lines in notes. The reason for this is that prior to the upgrade the "Title" of the note and the "Body" of the note were displayed separately. After the upgrade, Notes assumes the title is *not* also included in the body, which is different behaviour, and led to the apparent duplication.
Sadly there's no reliable way for the workflow to detect whether your Notes account has been upgraded or not, so fixing it would entail breaking it on installs that have not undergone this upgrade. Therefore I have opted to make a separate Workflow which is to be used by anyone who has upgraded to the new iCloud version of Notes. You will find that download link below.
Changelog:
Tuesday, 5th July 2016 - Fixed a regression where "nclip" would not work if a custom title was provided
Thursday, 30 June 2016 – Compatibility for users who did not previously have Alfred v2 installed
Wednesday, 27 January 2016 – Fixed an issue with notes from clipboard not working; existing iCloud notes are now searched too (thanks, Vero!)
Friday, 16 October 2015 – Added a new Workflow for iCloud upgraded notes in OS 10.11+ (Thanks Nikita!)
Monday, 27 October 2014 – workaround for apple bug #18734006 on OS 10.10
Monday, 13 October 2014 – Hold option to open note window after creation
Tuesday, 17 September 2013 – Updated q_workflow module to latest version
Thursday, 18 April 2013 – Only first line is used as a title when using "nclip" with no arguments
Sunday, 7 April 2013 – Properly escape illegal characters in query
Friday, 5 April 2013 – Fixed an issue where a temporary file was getting written to the wrong place, sorry about that!
Thursday, 4 April 2013 – Combined into single workflow; renamed to "Notes"; fixed an issue with clip keyword; nclip now pastes HTML if possible; workflow will notify if updates are available
Saturday, 16 March 2013 – First version
Download (Alfred v3 and iCloud) http://bit.ly/2w2mILX
Note: this workflow will notify you if a newer version is available. To disable this functionality, change the property "shouldCheckForUpdates" to "false"
Alfred v2
It's not currently known whether the latest release will be backward-compatible with Alfred v2.
If you are using Mac OS 10.11+ and have "upgraded" your iCloud notes, you should use this workflow:
Notes for Alfred v2 (iCloud)
In all other cases, this is the one to use:
Notes for Alfred v2 (non-iCloud)
You can manually download Alfred from our website (http://www.alfredapp.com/#download) and update this way.
There shouldn't be any issues updating from recent builds, but you may be on an older version. Installing the latest version from the URL above will resolve that.