Create MediaWiki Links to Evernote Items

Description

Originally posted at organognosi.com, this script creates links to Evernote notes which are compatible with MediaWiki markup language.

In order for the links to be recognized by MediaWiki, you should add the following line of code to the Localsettings.php file (Its path in my computer is /Applications/MAMP/htdocs/WikiName/LocalSettings.php): $wgUrlProtocols[] = “evernote://”;

Before executing the script you should have one or more notes selected in Evernote. The result is sent to the clipboard.

The Code

(*
Veritrope.com
Create MediaWiki Links to Evernote Notes
Written by John Sidiropoulos
Originally posted at http://www.organognosi.com
Version 1.0
January 26, 2012

// SCRIPT INFORMATION AND UPDATE PAGE
http://veritrope.com/code/mediawiki-evernote-links

// REQUIREMENTS
In order for the links to be recognized by MediaWiki, you should add the following line of code to the Localsettings.php file:

     $wgUrlProtocols[] = “evernote://”;

(Its path in my computer is /Applications/MAMP/htdocs/WikiName/LocalSettings.php)


// CHANGELOG
1.0   Initial release

*)




(*
======================================
// MAIN PROGRAM
======================================
*)


tell application "Evernote"
    set evernote_selection to selection
    set wikiLinks to {}
    set the clipboard to ""
    repeat with i from 1 to the count of evernote_selection
        set NoteURL to note link of item i of evernote_selection
        set noteName to title of item i of evernote_selection
        set theWikiLink to "[" & NoteURL & " " & noteName & "]<br />"
        set the clipboard to (the clipboard) & theWikiLink & return
    end repeat
end tell