Skip to content

Instantly share code, notes, and snippets.

View fractaledmind's full-sized avatar

Stephen Margheim fractaledmind

View GitHub Profile
@fractaledmind
fractaledmind / Create Tag Index Note With Hyperlinks to All Notes with that Tag
Created September 2, 2013 05:16
This script creates a new Note in the user's default notebook with hyperlinks to all of the notes with a given Tag. Thus, it creates a Tag Index note for a chosen Tag.
@fractaledmind
fractaledmind / Create Writing Project Template Notebook
Last active December 22, 2015 04:38
This script will create a new notebook for a new writing project and create a pre-set collection of blank notes for that project. Currently, the script creates notebooks aimed at academic writing projects.
property tb : ASCII character 9
property LF : ASCII character 10
tell application "Evernote"
set theQuery to display dialog "What is the title of your writing project?" with title "Project Notebook Template" default answer ""
set projectName to "@" & text returned of theQuery
if (not (notebook named projectName exists)) then
set nb to make notebook with properties {name:projectName}
else
set nb to notebook projectName
@fractaledmind
fractaledmind / Create Individual Notes In Evernote Based On Outline
Created September 2, 2013 23:56
This script takes an outline from the clipboard and creates a set of Evernote notes that correspond to each item in the outline. For optimal usage, I recommend outlining in Numeral format (1, 1.1, 1.1.1, 2, 2.1, 2.1.1, 2.1.2, etc), as this ensures that the notes remain in order within the notebook when sorted by title.
--get input text
set theText to the clipboard
--get each line of outline as list
set theList to paragraphs of theText
--remove tabs and empty line feeds from list
set cleanList to {}
repeat with i from 1 to count of theList
set thisItem to item i of theList
@fractaledmind
fractaledmind / Markdown Outline to Numbered Outline
Last active August 31, 2018 06:02
This script translates simple Markdown outlines into formatted numeral outlines. This script works from the clipboard, so it is totally application agnostic. This newest version allows for Outline Text along with your Markdown outline items and allows you to use any Markdown symbol for your outline ("*", "-", etc.)
(* CONVERT MARKDOWN LIST TO NUMERAL OUTLINE
-- Stephen Margheim
-- open source
This script translates simple Markdown outlines into formatted numeral outlines. For example, an outline of the the form:
- item 1
- sub-item 1
- sub-sub-item 1
- sub-sub-sub-item 1
- sub-item 2
@fractaledmind
fractaledmind / Export all Skim Notes to Evernote with Hyperlinks
Created September 7, 2013 23:15
This script will (as the title suggests) export all of you Skim notes directly to Evernote with hyperlinks. It relies on the GENERATE TOP 3 NOTES WITH SYSTEM URL script that will put 3 notes at the top of the PDF with linking information. When launched, the script will ask you if the current PDF is a Primary Source or a Secondary Source. Your ch…
@fractaledmind
fractaledmind / EXPORT ALL SKIM NOTES TO EVERNOTE WITH HYPERLINKS (Complete)
Last active January 9, 2017 01:36
REQUIRED PROGRAMS: - Skim (pdf viewer and annotator) - Evernote (cloud based note app) This script will (as the title suggests) export all of you Skim notes directly to Evernote with hyperlinks. It integrates the GENERATE TOP 3 NOTES WITH SYSTEM URL script that will put 3 notes at the top of the PDF with linking information. This means your PDF …
@fractaledmind
fractaledmind / Convert Markdown Outline to Numbered Outline (demo)
Last active December 23, 2015 03:29
This is a DEMO, with a preset input. To use, change "t" to your input type. This is a Python script converts any Markdown style outline into a nested, numbered outline.
t = '- item 1\n\t- sub-item 1\n\t\t- sub-sub-item 1\n\t\t\t- sub-sub-sub-item 1\n\t\t- sub-sub-item 2\n\t- sub-item 2\n- item 2'
# replace tabs with 'x's
nt = t.replace('\t', 'x')
# create list from string
l = nt.split('\n')
# split list into (A) list of prefixes and (B) list of text
pre_l = []
from evernote.api.client import EvernoteClient
dev_token = "put your dev token here"
client = EvernoteClient(token=dev_token)
userStore = client.get_user_store()
user = userStore.getUser()
print user.username
set aList to {"1", "2", "3", "4", "5"}
repeat with anItem in aList -- # actual loop
try
set value to item 1 of anItem
if value = "3" then error 0 -- # simulated `continue`
log value
end try
-- tell application "InDesignServer"
tell application "Adobe InDesign CS3"
set myDocument to make document
tell myDocument
tell page 1
set myTextFrame to make text frame
set geometric bounds of myTextFrame to {"6p", "6p", "18p", "18p"}
set contents of myTextFrame to "Hello World!"
end tell