Jump to content
smarg19

Wikify (Evernote Wiki-Helper)

Recommended Posts

Wikify

Your little Evernote Wiki-Helper

Version 2.6

 

Download at Packal

 

This is a workflow in progess, but Version 2.0 adds a tone of super helpful functions for dealing with Evernote for Markdown lovers. This is aimed at making it easier to create a personal wiki on your computer, using Evernote as the backbone. 

New complete documentation on my blog: http://bit.ly/1xA0D44

 

Current Features:

 

Version 2.0 adds four features to 1.2's functionality. Meaning these are the new functions:

  • Markdown to Evernote (mden)
    • document-specific text snippets (use ^^^snippet^^^ syntax)
    • auto-linking to pre-existing Evernote notes (no special syntax)
    • auto-linking to new Evernote notes (use [[double bracket]] syntax)
  • Evernote to Markdown (enmd)
  • Auto-Link to pre-existing notes for Selected Evernote note(s) (wfy)
  • Auto-Link to new notes for Selected Evernote note(s) (ensel)
See the posts below for more detailed accounts of these features.

 

NOTE: In order to use a number of these features, you will need the Satimage OSAX Scripting Addition. I've set it up such that this is remarkably easy to install. Simply use the keyword in Alfred wfy:install and the Satimage installer will boot up and walk you through the process.

 

Markdown to Evernote

 

The first feature allows you to write in any editor on your Mac in Markdown, and simply and easily send that data to Evernote as formatted HTML. In order to assign Note Title, Notebook, and Tags, you can use simple MultiMarkdown Headers, or simple symbols:

  • Title: or # for the note's title
  • Notebook: or = for the note's notebook destination
  • Tags: or @ for the note's tags
At import, Wikify comes with a Hotkey or a Keyword to launch this functionality. Simply select your text (ctr + A) and then hit your user-defined hotkey, or pop-up Alfred and type mden, and Wikify will instantly send you Markdown text to Evernote as fully-formatted HTML. 

Evernote to Markdown

 

Have you ever wanted to edit your Evernote notes in the plain-text glory of Markdown? If so, this is the feature for you. Using Aaron Swartz's glorious html2text Python script, Wikify will convert the currently selected Evernote note to a Markdown plain-text file. Wikify will save the .md file in its storage folder (~/Library/Application Support/Workflow Data/com.hackademic.wikify/). You can create a Markdown file of an Evernote note, edit it, and then send it back using the twin function. 

 

Let me know if you have any issues, and keep posted for further functionality.

 

stephen

Edited by smarg19

Share this post


Link to post

It creates a note but doesn't include the text in that note. No errors occur but here is the log:


 


 


Starting debug for 'EN-Wikify (v. 1.0)'


 


[iNFO: alfred.workflow.input.keyword] Processing output 'alfred.workflow.action.script' with arg ''


[iNFO: alfred.workflow.action.script] Processing output 'alfred.workflow.output.notification' with arg 'Created 2014.03.27 in @Inbox


'


 


I also just recorded a quick screencast showing Markdown to Evernote (doesn't work completely) and Evernote to Markdown (works) (sorry no audio) 


 


http://quick.as/4qveuqga


Share this post


Link to post
Brian, 

 

Thanks for the bug report. It was a foolish mistake on my part. EN-Wikify has 2 ways of launching the Markdown->Evernote script: [1] hotkey or [2] keyword mden. I use the hotkey, and hadn't tested the keyword (out of foolishness). The hotkey allows Alfred to pass the selected text to the script, which then processes it and sends it to Evernote. The keyword does not. So, in order to use the keyword as the script launcher, you will need to select the whole text, and then copy it to the clipboard, then run mden

 

I've just uploaded version 1.1 to Packal with this change. Please upgrade and let me know how it goes :)

 

stephen

Share this post


Link to post
UPDATE: Version 1.2
 
Version 1.2 adds two new features that I have started using a lot in my note taking:
  • Document-specific text snippets
 
Let me explain them each in turn. 
 
First, document-specific text snippets. This feature was inspired recently as I was taking notes in class. In-class note-taking is a bit unique, since you won't exactly know what words will be used repeatedly before the class begins. I'm all about TextExpander, but I can't set up snippets if I don't know what will be the key-words for that class. Plus, I don't want to clutter my TextExpander library with these one-off snippets. So, document-specific text snippets was born. The idea is to use snippets in your notes as you type, and then define the snippet:expanded text relationship before you use EN-Wikify to send the notes to Evernote. The syntax is dead-simple. Simply wrap your "snippet dictionary" in triple carets (^^^snippet:expanded text^^^). You can have one-off "dictionaries" or you can make one long dictionary at the end of your document. The only things you need to remember are:
 
  • ALWAYS use ,, as your in-text prefix
  • if its a one-off (only one snippet), the "dictionary" needs to exist on its own line
  • if its a multi-snippet "dictionary", use the triple carets like fenced code blocks
 
To ensure these few easy syntax rules makes sense, here's an example:

,,p are separated by a blank line.
^^^p:Paragraphs^^^
New text.
 
2nd paragraph. *,,i*, **,,b**, `,,m`. 
^^^
i:Italics
b:BOLD
m:monospace
^^^
 
Thats all there is to it. Note how each snippet is prefixed by ,,. This ensures that both you and the processor know what text needs to be expanded, and you don't need to have the commas in the snippet dictionary. You can mix and match single-line snippet dictionaries with multi-snippet dictionaries in the same document. You can even use non-ASCII characters in your snippets or in your expanded text. For me, this is a killer feature. I hope someone else finds it useful.
 

Second, SearchLink-style Evernote linking. Since this workflow is called "EN-Wikify", it's about time we got some wiki-style functionality. I love to link my myriad of Evernote notes together. I think that inter-note linking is an easy and effective way to take your notes to the next level. It's like creating your own personal Wikipedia. But, it's not all that easy in the Evernote app to pop a link to another note into your current note. Plus, I always write outside of the Evernote app in Markdown. So, what to do? This feature borrows the basic syntax of Brett Terpstra's SearchLink script to create a simple, Markdown-style linking syntax for your personal Evernote notes. In its simplest form, this functionality accepts links in this format: Linked text. When your note is processed by EN-Wikify, it will search your entire Evernote library for a note whose title contains "Linked text". If it finds one it will replace the (!en) with a hyperlink to that Evernote note. But since Evernote allows for shared note titles, and I know many of us have huge libraries, I've added some further syntax so that you can limit the search scope. You can use =notebook or @tag within the (!en) section to limit the search to a specific notebook or specific tag, or even a specific tag in a specific notebook. Here are a few examples:
  • [query](!en =notebook)
  • [query](!en @tag)
  • [query](!en =notebook @tag)
 
The first will search the notebook entitled notebook for a note whose title contains query. The second will search all notes with the tag tag for one whose title contains query. And the third will search all notes in notebook notebook tagged with the tag tag whose title contains query. Make sense? 
 
When EN-Wikify processes your Markdown text now, it will expand all in-text defined snippets and link to all queried Evernote notes. It's pretty sweet. 
 
Let me know how you like the new features,
stephen
Edited by smarg19

Share this post


Link to post

MAJOR UPDATE
 
Version 2.0
 
At long last, some full-featured wiki-functionality is here. Gone are the days of SearchLink-style syntax. Wikify now automatically will hyperlink to any pre-existing Evernote notes referenced by title in your note text. For example, let's say I was typing up a note with this content:



# Note Title
= Notebook
@ tag1, tag2

This is the first line of my new note on Alfred App!

Now, if I had a note in my Evernote account entitled "Alfred App", when I process this note to send it to Evernote, Wikify will now catch that and hyperlink to that pre-existing note, so this new note would have the phrase "Alfred App" linked directly to that other Evernote note. No fuss, no hassle, no funky syntax. And (this is what was holding me back on this feature for while), this is SUPER-FAST! Now, you can inter-link (i.e. wikify) your Evernote data even more easily. This feature is added on top of the in-text snippets feature from Version 1.2 (see above post), but replaces the SearchLink syntax feature. 
 
So, to create a new Evernote note with this auto-linking functionality, simply type up your note text in Markdown format in your text editor of choice, then either:

  • select the text and use your user-specified key-board shortcut, or
  • copy to the text and use the keyword mden (for "Markdown to Evernote")

But this isn't even all of the new features. What if you want to interlink any of your current Evernote notes? You can use this auto-linking power for current Evernote notes as well. Simply open up Evernote and select the notes you want to wikify (the workflow does accept multiple selections). Once your notes are selected, pull up Alfred and use the wfy (short for "wikify") keyword. The workflow will then process each of your notes individually, auto-linking to any pre-existing other notes which it references by name. NOTE: In order to use this feature, you will need the Satimage OSAX Scripting Addition. I've set it up such that this is remarkably easy to install. Simply use the keyword in Alfred wfy:install and the Satimage installer will boot up and walk you through the process.
 
But wait, there's more! :) While half of wiki-functionality is smooth linking to any pre-existing data, the other half is smoothly creating new spaces to fill with data later, while simultaneously creating the inter-linking between notes. Wikify has you covered here as well. Let's say as you're typing up a new Evernote note, you realize that you are discussing an idea, topic, or person that you want to research further, but at some later date. What to do? Well, you can use the standard wiki-syntax of the [[double brackets]] to mark that idea, topic, or person as something you want to create a new note for, while also linking to that new note from within your current note. To return to our sample note above, let's say you added this:

# Note Title
= Notebook
@ tag1, tag2
 
This is the first line of my new note on Alfred App!
 
I want to talk more about [[AppleScript]].

Whenever you have Wikify process this Markdown text and send it to Evernote, it will first create a new note (in the notebook you specify in the meta-data) entitled "AppleScript" then embed the Evernote hyperlink to that new note within this current note. This means that your new Evernote note will have 2 links: one to the pre-existing note "Alfred App" and one to the newly created, blank note "AppleScript". This functionality is bundled into the mden keyword script, so there's nothing new to learn here. 
 
However, let's say that you are in Evernote and see a phrase or term in one of your notes that you want to research more, while creating the wiki-environment that Wikify is all about. I've added a companion feature which will:

  • take the currently selected text in the open Evernote note
  • create a new note in that notebook whose title is the selected text
  • embed a hyperlink back to the original note as the first line of this new note
  • and replace the selected text with a hyperlink to that newly created note

This means that you have two-way hyperlinking (which is impossible in the mden version of this functionality) between your current note and your new note. Creating spaces for new thought, while retaining context and wiki-style hyperlinking has never been easier. To use this feature, you can either use a user-specified keyboard shortcut, or copy the selected text to the clipboard and run ensel
 
I'm really excited about this new point release. I've been dreaming about creating these features for around a year now, and it's great to finally see them come to light. If you use Evernote much at all and like the idea about inter-connecting your data, I really think that this is the best possible collection of tools and scripts to make it as easy as possible. 
 
Let me know how you use it, I'd love to hear.
 
stephen

Share this post


Link to post
Version 2.1 utilizes Alfred's new app-specific keyboard shortcuts, so that enmd, ensel, and wfy are all dependent on Evernote being the app in focus. 

 

Also, one bug fix in the wfy script.

 

Please update via Packal

Edited by smarg19

Share this post


Link to post
Mid-Level Update: 2.3

 

Do you keep important reference PDFs in the same directory tree? Would you like a dead-simple way to hyperlink to PDFs from Evernote? Do you use the PDF viewer Skim

 

If you answer to each of these questions, this update will be for you. I personally have all of my PDFs in one directory tree, and I love interconnecting my data. In this update, I've applied the same logic used in the auto-link to pre-existing Evernote notes to PDFs, using a custom URL handler that I developed to utilize Skim's applescriptability to create hyperlinks that open PDFs!

 

To use, you will need to change line 14 in the md2en.py script to the root folder of your PDF directory (this directory can include sub-directories with PDFs in them). After that, Wikify will auto-link to any PDFs in that directory tree that you reference by title in your note. Currently (I will fix this soon), you name the PDF file without the extension, tho the extension will be added to the hyperlink (for readability sake). I have yet to write a companion function for wfy to update current Evernote notes, so this currently only works on Markdown text you send to Evernote via mden

 

This is a niche function perhaps, but it requires no special syntax and could prove helpful (I like it). Let me know if you think this is helpful. (Teaser: keep your eyes out for the update to my Skimmer workflow for exporting PDF notes from Skim to Evernote using this same URL handler). 

 

Update on Packal.

Share this post


Link to post

Update: Version 2.4 now up on Packal. 

 

This version fixes a bug with Unicode characters in the Title, Notebook, or Tags metadata. 

 

Grab the new version on Packal.

Share this post


Link to post

I have installed Satimage OSAX Scripting Addition by launching `wfy:install` command. Then,

 

I created a `test` notebook in my EN and then created the three notes inside this notebook (all inside `` are literal):

note 1: title `testToC` content `[[test123]] [[test456]]` 

note 2: title `test123` content `test123content`

note 3: title `test456` content `test456content`

 

I activated EN, selected `testToC` note, pressed hotkey to activate Alfred 2, and launched `wfy` command, and the content of `testToC` became:`

a href="evernote:///view/68167443/s414/1aace19a-8cfd-4a7c-8250-390aa1feee1b/1aace19a-8cfd-4a7c-8250-390aa1feee1b/">xml</<a href="evernote:///view/68167443/s414/8e75a37c-cf34-4638-b85f-63c2f8fd7e80/8e75a37c-cf34-4638-b85f-63c2f8fd7e80/">a> version="1.0" encoding="UTF-8"?>a href="evernote:///view/68167443/s414/1cac7644-8c4f-4c97-a465-c5f5757a2631/1cac7644-8c4f-4c97-a465-c5f5757a2631/">EN</<a href="evernote:///view/68167443/s414/8e75a37c-cf34-4638-b85f-63c2f8fd7e80/8e75a37c-cf34-4638-b85f-63c2f8fd7e80/">a>" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[[test123]] [[test456]]
`
 
Could you please give an example of using `wfy` command?
 
Thank you!
Edited by hsslfss

Share this post


Link to post

Update: Version 2.4 now up on Packal. 

 

This version fixes a bug with Unicode characters in the Title, Notebook, or Tags metadata. 

 

Grab the new version on Packal.

 

Using the example in my previous post, I selected `test123content` of the note titled `test123`, and an error window popped up.

Screen%20Shot%202014-05-12%20at%2022.58.

 

---

EN (non-MAS) just checked, it's the latest version 5.5.1.

Alfred 2 (non-MAS, powerpack) just checked, it's the latest version 2.3 (264).

OS X 10.9.2, just checked, no new updates.

Edited by hsslfss

Share this post


Link to post

Hmm... I just tried to recreate your error, but without "success". Could you open Alfred and run these command with the debugger on? Its the small bug icon in the top right corner of Alfred in the Workflows pane. Simple open Alfred's Preferences, go the Workflow pane, open Wikify, start the debugger, then run your tests. 

 

Also, could you detail exactly what you are doing? These smaller details may be what I need to parse out the problem and then fix it. 

 

Thank you,

stephen

Share this post


Link to post

Hmm... I just tried to recreate your error, but without "success". Could you open Alfred and run these command with the debugger on? Its the small bug icon in the top right corner of Alfred in the Workflows pane. Simple open Alfred's Preferences, go the Workflow pane, open Wikify, start the debugger, then run your tests. 

 

Also, could you detail exactly what you are doing? These smaller details may be what I need to parse out the problem and then fix it. 

 

Thank you,

stephen

 

Sorry, I was busy with my coursework.

 

I will redo this

"You can use this auto-linking power for current Evernote notes as well. Simply open up Evernote and select the notes you want to wikify (the workflow does accept multiple selections). Once your notes are selected, pull up Alfred and use the wfy (short for "wikify") keyword. The workflow will then process each of your notes individually, auto-linking to any pre-existing other notes which it references by name. NOTE: In order to use this feature, you will need the Satimage OSAX Scripting Addition. I've set it up such that this is remarkably easy to install. Simply use the keyword in Alfred wfy:install and the Satimage installer will boot up and walk you through the process."

 

I realised square brackets cause the previous output. So I remove square brackets this time. Note 2 and note 3 remained the same, the note was the same, and note 1 was changed to "

test123

test456

"

 

I selected note 1 and run wfy on Alfred. And the output was "

xml version="1.0" encoding="UTF-8"?>EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

test123

test456

"

 

The debugger recored was "

Starting debug for 'Wikify'

 

[iNFO: alfred.workflow.input.keyword] Processing output 'alfred.workflow.action.script' with arg ''

"

 

 

Sorry again for my late reply!

 
Thank you!
 
Best regards,

 

---

Does http://www.alfredforum.com/ supports markdown reply? So many small buttons, I don't know where to find markdown button. Does anyone know it? Thank you!

Edited by hsslfss

Share this post


Link to post

Hi There,

 

Sounds neat. I have it half working, but have a couple of issues:

 

1) wfy:install does nothing. I waited a while, nothing. So I just followed the link and installed it myself.

 

2) I can add notes to Evernote via the md command. It also detects phrases that match titles and linkifies them. So far so good. But clicking on the link yields an error message in Evernote. Looking at the link, this is what it's set to:

 

 

evernote-html-snippet:///missing%20value

 

Obviously, something went wrong somewhere. How do I debug what's going on?

 

Thanks!

Share this post


Link to post

Are the broken links ones to pre-existing notes or to new notes wrapped in [[double brackets]]? Also, can you run wfy:install with the Alfred debugger on and post the information for me? I'll see what I can do.

Share this post


Link to post

Hi There,

 

Sounds neat. I have it half working, but have a couple of issues:

 

1) wfy:install does nothing. I waited a while, nothing. So I just followed the link and installed it myself.

 

2) I can add notes to Evernote via the md command. It also detects phrases that match titles and linkifies them. So far so good. But clicking on the link yields an error message in Evernote. Looking at the link, this is what it's set to:

 

 

evernote-html-snippet:///missing%20value

 

Obviously, something went wrong somewhere. How do I debug what's going on?

 

Thanks!

 

 

Are the broken links ones to pre-existing notes or to new notes wrapped in [[double brackets]]? Also, can you run wfy:install with the Alfred debugger on and post the information for me? I'll see what I can do.

 

It does nothing because Satimage392.pkg is from an unidentified developer.

 

You have to right click the file then press option key in order to enable the installation.

 

@ smarg19: maybe you should take a look of the workflow I did in this topic (yet to be released in this forum).

Share this post


Link to post

Good point. I'll look into it and refactor. To @vthunder, look in the workflow folder, right click the .pkg file and select open, that will install it.

Share this post


Link to post
Any guidance on this, e.g.,

 

mden, works fine,

ensel, crashes Evernote,

 

On the installation of Satimage.osax, done,

 

I am trying to figure out the below, 

 

Starting debug for ‘Wikify,’ 4 June 2014

 

[ERROR: alfred.workflow.action.script] Code 1: pkg_installer.scpt: execution error: xattr: No such file: /Users/moses/Box

xattr: No such file: Sync/AlfredSyncFolder/Alfred.alfredpreferences/workflows/user.workflow.8F196C8C-BA74-4DC4-A6D7-A9F5E51D3ADC/Satimage392.pkg (1)

[ERROR: alfred.workflow.action.script] Code 1: pkg_installer.scpt: execution error: xattr: No such file: /Users/moses/Box

xattr: No such file: Sync/AlfredSyncFolder/Alfred.alfredpreferences/workflows/user.workflow.8F196C8C-BA74-4DC4-A6D7-A9F5E51D3ADC/Satimage392.pkg (1)

[ERROR: alfred.workflow.action.script] Code 1: wikify_sel.scpt: execution error: Evernote got an error: "<body.*?>(.*?)</body>" doesn’t understand the “«event SATIFINd»” message. (-1708)

[ERROR: alfred.workflow.action.script] Code 1: wikify_sel.scpt: execution error: Evernote got an error: "<body.*?>(.*?)</body>" doesn’t understand the “«event SATIFINd»” message. (-1708)

[ERROR: alfred.workflow.action.script] Code 1: wikify_sel.scpt: execution error: Evernote got an error: "<body.*?>(.*?)</body>" doesn’t understand the “«event SATIFINd»” message. (-1708)

[ERROR: alfred.workflow.action.script] Code 1: ensel2note.scpt: execution error: Evernote got an error: Connection is invalid. (-609)

[ERROR: alfred.workflow.action.script] Code 1: ensel2note.scpt: execution error: Evernote got an error: Connection is invalid. (-609)

[ERROR: alfred.workflow.action.script] Code 1: ensel2note.scpt: execution error: Evernote got an error: Connection is invalid. (-609)

[ERROR: alfred.workflow.action.script] Code 1: ensel2note.scpt: execution error: Evernote got an error: Connection is invalid. (-609)

[ERROR: alfred.workflow.action.script] Code 1: ensel2note.scpt: execution error: Evernote got an error: Connection is invalid. (-609) 

 

Further, And wfy yields:

 




 

Share this post


Link to post

Ok. ensel shouldn't crash Evernote. You only have one note selected? With how much text selected in that note? I need more details to try and track down the problem. Maybe run Alfred debugger with ensel as well.

As to installing Satimage, there appears to be a bug where file paths with spaces aren't properly escaped. I'll look into it and post an update when I have one.

Thanks for the feedback.

stephen

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×