Skip to content

Instantly share code, notes, and snippets.

@fractaledmind
Last active December 28, 2015 07:09
Show Gist options
  • Select an option

  • Save fractaledmind/7462485 to your computer and use it in GitHub Desktop.

Select an option

Save fractaledmind/7462485 to your computer and use it in GitHub Desktop.
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).
This script reads an Evernote .txt cache file which is created by using the "Evernote Cache" script and extracts relevant data. This method allows for near instantaneous search and retrieval of Evernote data, without pinging the Evernote app or the Evernote server.
The best use of these examples is within larger workflows that require extracting Evernote data. This script is more about demonstrating the possiblities than about being actually useful.
*)
--BE SURE TO PUT THE CORRECT PATH TO YOUR CACHE TEXT FILE
property cachePath : ":Users:[username]:Desktop:Evernote Cache.txt" as alias
property tid : AppleScript's text item delimiters
property dataTypes : {"name", "creation_date", "modification_date", "subject_date", "source_url", "latitude", "longitude", "altitude", "tags", "notebook", "note_link", "reminder_time", "reminder_done_time"}
set noteCache to readtext cachePath
tell application "JSON Helper"
set json to read JSON from noteCache
end tell
set result_list to {}
repeat with i from 1 to count of json
set thisNote to item i of json
--change the data field to whatever you are searching
if tags of thisNote contains "wikify" then
--change the data field to whatever you want returned
copy |name| of thisNote to end of result_list
end if
end repeat
result_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment