Alfred Evernote

Posted on  by 



  1. Alfred Evernote Search
  2. Alfred Evernote
Alfred

I’m a big fan of using the Mac productivity tool Alfred and I use Evernote to store all sorts of snippets of information. Alfred is free, but if you purchase the Power Pack, you gain the ability to add custom scripts via Alfred extensions. While browsing the extension gallery, I stumbled on the Evernote extension by Kristian Hellquist that allows you to use Alfred to create a note in Evernote with the subject and tags that you specify. However, using the default script, you cannot add content to your note via Alfred and Evernote does not come to the front.

A Workflow for the OS X app Alfred2: Search, Create, Append, Preview, set Reminders. All within Alfred. Amongst the many workflows created by Alfred users, the Evernote workflow by Carlos A. Sztoltz is one of the best ways to search or browse your Evernote library, as well as create notes and reminders. Find this workflow and more on the Alfred forum.

Typically, when I want to create a new note in Evernote, I have something specific that I want to make a note about, and it seemed that having to then click on the note you just created in Evernote to add content defeated the purpose of using Alfred. Within a few hours of asking about this, Kristian was kind enough to create a new script that brings the note you just created to the front for you to add content to. To use this alternate script, copy Kristian’s gist found here and then update the original Evernote script by going to the Extensions tab of Alfred’s preferences.

12 Jun 2011
  1. A web site about using technology efficiently, and other things.
  2. Alfred-evernote-workflow use html cache to enable note preview feature. This command save html caches of all of notes from your Evernote client. When the command is running, you are not able to run note searches with the `ens` command. In this case, the `ens` command displays the number of notes that are cached to show you progress.
  3. Evernote workflow for Alfred 4.
IMPORTANT: Please see additional updates at the end of this post.

Evernote is my ubiquitous deposit spot for the overflow from my brain andeveryday (unlike my brain) it grows in size. Being able to access theinformation held in Evernote in as easy a manner as possible is a keypart of the way I work and I recently wrote a little script to make itthat little bit better. The script allows me to searchEvernote from Alfred (a keyboard driven app launcher onmy Mac) which is always just a hot key away.

Evernote

So first of all why did I bother writing this script? Ignoring the“because it’s fun” element to a lot of the things I do, there are tworeasons.

The first is that whilst I spend a lot of time in Evernote, I don’talways have it open and even when I do, I frequently don’t want tonavigate away from what I already have open in order to search forsomething else.

The second relates to the inbuilt Mac search facility - Spotlight.Whilst this can include searching for notes within Evernote, it alsoincludes stuff not in Evernote (and if I want to search Evernote I’musually pretty sure that what I want is in there). Since Spotlightdoesn’t support the more advanced search syntax (e.g. “tag:”,“-notebook:”) this also makes it less useful to me.

Alfred is constantly running on my Mac and at the press of a keyboardshortcut it presents me with a window I can type something into and thiscan then do things such as open an application, initiate a web search oreven run a script. So it made sense to me that I could get Alfred totake a command with an Evernote search string as the parameter and passthat to an AppleScript to search Evernote for me and display the resultsin a new Evernote window.

So here’s how it’s done…

So the first step is to create the script that Alfred actually calls.It’s really quite a simple script thanks to the Evernote Applescriptintegration that does the hard stuff. So open the AppleScript editor andcopy the script below into it. You can then save it as something like“search evernote.scpt” in your script folder. I actually have a numberof Evernote related AppleScripts so I have a dedicated Evernote folderwithin my scripts folder (as you’ll see below).

So what does the script do? When you run the script it takes all of theparameters that you pass to it and then tells Evernote to open a newwindow using that list of parameters as your search query.

There’s a bit of tweaking to put the parameters back into the format youtyped them in. By default a space in your search string would indicatean additional parameter to the script, so we have to take all of theparameters and put a space back between each one to reconstitute theoriginal search term. It saves having to put your search query in doublequotes each time when you type it into Alfred.

By default AppleScript will probably want to put your script into the“Library/Scripts” folder in your personal (home) folder. You may havedecided to pop it into Dropbox or some othercloud storage sync’d folder so you can keep this script available on allyour Macs. It’s all good, just make sure you know exactly where thescript is and what it is called.

For example, my script can be defined in terms of location by'/Users/stephen/Library/Scripts/Evernote/search evernote.scpt'. Pleasepay careful attention to alphabetic case.

We now need to create a shell script to call the AppleScript.Fortunately this is really simple to do. Simply add the path to thescript after osascript. For my script this would look like this:

So the last thing to do is to pass some search parameters. If we wereactually running this from the terminal app, we would just type themafter the script location path. However because we’re going to useAlfred we need to pop a special placeholder in there instead - the wordquery in curly braces. So again for me this looks as follows:

Alfred evernote

So now we have a shell command for Alfred to carry out we need toconfigure Alfred to know when to carry out this command. Make sureAlfred is running and use your shortcut key combination to bring it intothe foreground to enter your command (I use ALT+Space). Next click thesettings icon in the top right corner of the Alfred window. It lookslike a little cog. This will bring you into the Alfred settings window.Alternately if you have the Alfred icon in your menu bar, you can get tothe settings window from that.

Next select the “Features” panel and look down on the left hand sideunder “SYSTEM” for an option called “Terminal / Shell”. Selecting thiswill display Alfred’s preferred terminal application as well as a prefixfor executing terminal commands from within Alfred, and a set ofshortcuts. In our case we need to configure the shortcuts.

So click on the “+” button beneath the shortcuts list to bring up a newterminal shortcut window. In the “Title” field type a descriptive namefor your script (e.g. “Evernote Search”) and a suitable description(e.g. “Quick search within Evernote”) in the “Description” field.

The “Keyword” field should be set to whatever you want to use to call upthe Evernote search. For example you might like to use something like$EN?

The “Command” field is where the command set out in step 2 should beentered. Along with this also make sure that the checkbox for “quotes”is also checked (leave the one for “spaces” unchecked).

Alfred Evernote

You can also set an icon for your custom terminal command. You can justdrag and drop an image or icon file onto the icon drop area in the topright of the window. If you don’t have one to mind I’d recommend agreen striped magnifying glass from Icon Archive.

Once you have all the details configured, click on “Save”. Your customterminal shortcut will then appear in the list. Brit hume (@brit hume) twitter. The entry also has twocheckboxes. Tick the “Silent” checkbox. This will mean that when Alfredruns the command it will run it silently without opening a Terminal appwindow.

Everything should be set to give it a go. As you type in your specialkeyword (e.g. “$EN” into Alfred you simply follow this by the searchquery you want to perform. There are a couple of examples below, but youcan get lots more information from the Evernote search documentation.

Alfred

Search all notebooks for notes containing the words “apple” and“script”.

  • $en apple script

Search notebook “Evernote Stuff” for notes containing the word“AppleScript” and tagged as a “script”

  • $en notebook:'Evernote Stuff' tag:script AppleScript

One issue I had when creating this set-up was if I used “~” in thelocation of my home folder (step 2), the script ceased to function whenthe “Silent” checkbox was ticked (in Alfred). Now this may be somethingpeculiar to my Mac configuration or it may be a quirk in Alfred. In anycase explicitly setting the path meant it works with or without the“silent” checkbox ticked.

  1. The latest version of Alfred has an easier way to add this functionality by just importing the package I created - see my Search Evernote from Alfred (Again…) post.
  2. Alfred 2.0 was released into Beta in January 2013. The search is now included as part of the Evernote Search+ workflow for Alfred 2.0.
Author:Stephen MillardAlfred Evernote
Tags: | alfred | evernote | mac |


Related posts that you may also like to read

  • Alfred Workflow - Drafts

    22 Apr 2021

    Building on my recent spate of Alfred workflow posts, it’s time to share my most complex workflow to date, and it is for one of my favourite applications, Drafts. As you might know I do quite a lot with Drafts, and I’m really excited to share what I’ve come up with as a 1.0 workflow. It might be a bit more than you expect, and it is certainly far more than I had expected! Pam bv driver download.

    Read More
  • Alfred Workflow - Keyboard Maestro

    23 Mar 2021

    If you speak to anyone who more than dabbles in automation on macOS, Keyboard Maestro is almost certainly going to be a utility that gets mentioned. I’m certainly no stranger to the application and have been using it for over a decade to manage a large proportion of my Mac automations. But when you invest like that, you do tend to build up a large set of macros and having memorable ways to access them with short codes, hot keys, gestures, palettes, etc. can become a little overwhelming. I’m personally much better at remembering parts of the names and so searching an index of the available macros helps me with the ones I don’t have in regular circulation, and that’s what today’s Alfred workflow enables.

    Read More
  • Alfred Workflow - Amphetamine App

    22 Mar 2021

    Recently I’ve been working on smartening up some of my personal workflows for Alfred, the launcher application for macOS. I’ve been a long time user of Alfred and while I created a popular workflow for working with Evernote back in it’s early days, I’ve not posted something about Alfred for the best part of a decade. This seems ridiculous to me given how often I use it and how embedded it is in so much of the way I work on my Mac.

    The time is long overdue to put change that and I have several workflows to share in the not too distant future. Today, I’ll be starting off with one of my simpler workflows, but one that I use regularly. It is one to control the Mac app known as Amphetamine.

    Read More
  • Revisiting an Evernote Daily Journal

    31 Oct 2020

    I’ve been a long time Evernote user and while the application and services have certainly seen a lot of issues arising in the last decade, I still rely on it for some of my workflows. One of these is my daily journal, and this is a topic I have written about several times before. I recently had a bit of a change to this, and it is time for another quick write-up. Grapes.

    Read More




Coments are closed