Skip to content

Instantly share code, notes, and snippets.

View fractaledmind's full-sized avatar

Stephen Margheim fractaledmind

View GitHub Profile
@fractaledmind
fractaledmind / Markdown2HTML via Applescript
Created November 9, 2013 06:05
This is sample code for running the MultiMarkdown conversion script from Applescript via the shell. This script takes Markdown styled plain text from the clipboard and returns HTML text
property markdownloc : "/usr/local/bin/multimarkdown"
set mdSource to the clipboard
set rawHTML to do shell script "echo " & the quoted form of mdSource & " | " & markdownloc
@fractaledmind
fractaledmind / Markdown2Evernote
Created November 9, 2013 08:06
REQUIREMENTS: MultiMarkdown, Evernote. This script accepts text from the clipboard in (Multi)Markdown format and passes it to Evernote as HTML. The script also accepts 3 lines of metadata: Title, Notebook, and Keywords.
property markdownloc : "/usr/local/bin/multimarkdown"
property tid : AppleScript's text item delimiters
set mdSource to the clipboard
--check for Title metadata
try
if text item 1 of paragraph 1 of mdSource = "#" then
if not text item 2 of paragraph 1 of mdSource = "#" then
set theTitle to text items 3 thru -1 of paragraph 1 of mdSource as string
@fractaledmind
fractaledmind / Evernote2Markdown
Last active December 27, 2015 20:09
REQUIREMENTS --Satimage osax plugin for Applescript --Aaron Swartz's html2text python script --Evernote This script takes your currently selected Evernote note and generates a Markdown copy of it in your Documents folder. It will then automatically open the new Markdown text file and holds the Markdown itself in the clipboard.
(* EVERNOTE TO MARKDOWN
--Stephen Margheim
--11/9/13
--open source
REQUIREMENTS
--Satimage osax plugin
--Aaron Swartz's html2text python script
--Evernote
@fractaledmind
fractaledmind / Markdown2Evernote with AutoLinking to New Notes
Last active July 9, 2019 04:47
REQUIREMENTS: The Satimage osax plugin for Applescript, MultiMarkdown, and Evernote. This script accepts Markdown-styled text from the clipboard and converts it to HTML to create a new note in Evernote. This new version adds the feature of extracting [[double bracketed]] words and phrases and creating new notes for those phrases and embedding th…
property markdownloc : "/usr/local/bin/multimarkdown"
property tid : AppleScript's text item delimiters
set mdSource to the clipboard
if is_running("Evernote") = false then
tell application id "com.evernote.Evernote" to launch
tell application "System Events"
set visible of process "Evernote" to false
@fractaledmind
fractaledmind / Parse Evernote JSON Cache
Last active December 28, 2015 07:09
REQUIREMENTS: - JSON Helper (http://www.mousedown.net/mouseware/JSONHelper.html) - Satimage osax Applescript plugin (https://www.macupdate.com/app/mac/16798/satimage-osax) - an Evernote data cache, properly formatted, created by [this script](https://gist.github.com/smargh/7462510). This script reads an Evernote .txt cache file which is created …
(* PARSE EVERNOTE CACHE FILE
--Stephen Margheim
--11/13/13
--open source
REQUIREMENTS:
- JSON Helper (http://www.mousedown.net/mouseware/JSONHelper.html)
- Satimage osax Applescript plugin (https://www.macupdate.com/app/mac/16798/satimage-osax)
- an Evernote data cache, properly formatted, created by [this script](https://gist.github.com/smargh/7462510).
@fractaledmind
fractaledmind / Create JSON Evernote Cache
Last active July 9, 2019 04:51
Creates cache of Evernote note data in JSON format. Once created, this .txt cache can be read and searched much more quickly than pinging the Evernote app with each script you write. This script should be saved as a Stay open after Run application. It will ping your system every (default) 3 hours to see if the cache hasn't been updated today. If…
(* CREATE JSON EVERNOTE CACHE
--Stephen Margheim
--11/14/13
--open source
Creates cache of Evernote note data in JSON format.
Once created, this .txt cache can be read and searched much more quickly than pinging the Evernote app with each script you write.
@fractaledmind
fractaledmind / BibTeX2JSON
Last active December 28, 2015 13:09
REQUIREMENTS: --Satimage osax Applescript plugin --JSON Helper (only if you want to test the validity of the JSON output) This script attempts to convert a BibTeX file into JSON formatted text. All of my tests were done with BibTeX files generated by the Mac app BibDesk.
(* CONVERT BIBTEX TO JSON
--Stephen Margheim
--11/16/13
--open source
REQUIREMENTS:
--Satimage osax Applescript plugin
@fractaledmind
fractaledmind / Generate MMD CiteKey from BibDesk Search
Created November 17, 2013 22:33
REQUIREMENTS: - BibDesk This script allows you to search your BibDesk database and insert either a short MultiMarkdown cite key or a long MMD cite key.
@fractaledmind
fractaledmind / Parse BibJSON Text File
Created November 18, 2013 17:33
REQUIREMENTS: -JSON Helper This script reads the JSON text file that houses your bibliographic data. It allows you to search and insert MultiMarkdown cite keys into your document.
(* PARSE BIBJSON TEXT FILE
--Stephen Margheim
--11/18/13
--open source
REQUIREMENTS:
-JSON Helper
This script reads the JSON text file that houses your bibliographic data. It allows you to search and insert MultiMarkdown cite keys into your document.
@fractaledmind
fractaledmind / Create and Autolink to new Evernote Note from Selection
Last active April 21, 2020 12:06
This script takes text selected from within an Evernote note and (1) creates a new note whose titles matches the selected text in the same notebook, (2) embeds a link to the original note as the first line of the new note, and (3) replaces the selected text with a link to the newly created note. This allows you to easily create a wiki-like envir…