Skip to content

Instantly share code, notes, and snippets.

View fractaledmind's full-sized avatar

Stephen Margheim fractaledmind

View GitHub Profile
@fractaledmind
fractaledmind / Generate Top 3 Notes in Skim
Last active December 20, 2015 03:59
This script will insert 3 notes at the top of your open Skim PDF. These notes contain linking information that is used in the EXPORT ALL SKIM NOTES script.
(* GENERATE 3 INITIAL SKIM NOTES WITH LINKING INFO (CUSTOM URL VERSION)
-- created by Stephen Margheim
-- 13 July 2013
-- open source
REQUIRED PROGRAMS:
-- Skim
This script requires setting up the custom URL handler described [here](http://hackademic.postach.io/page/create-a-custom-url-scheme-for-free).
@fractaledmind
fractaledmind / Export All Skim Notes with Markdown Reference Links
Created July 24, 2013 04:37
This script will (as the title suggests) export all of you Skim notes to a text editor (either TextEdit or TextMate) in Markdown format, with reference style links. 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.
@fractaledmind
fractaledmind / Insert Markdown Link to Chosen PDF
Created July 24, 2013 04:39
Script inserts Reference Link to selected PDF into either TextEdit or TextMate document. The link uses my custom URL scheme.
@fractaledmind
fractaledmind / Insert Markdown Reference Link to Evernote Note
Created July 24, 2013 04:42
Script inserts link to either selected note or chosen note in Evernote.app. This scripts creates Markdown Reference Links in either TextEdit or TextMate document.
@fractaledmind
fractaledmind / Insert Markdown Inline Link to Evernote Note
Created July 24, 2013 04:43
Script inserts Markdown Inline Link (as opposed to my other script, that creates Reference Links) into open TextMate document.
@fractaledmind
fractaledmind / Accept, Reject, Alter CriticMarkup Doc
Last active December 20, 2015 04:08
This script allows you to handle, one-by-one, changes in your text document put in CriticMarkup format. All 5 forms of CriticMarkup syntax are supported: Add, Delete, Substitute, Comment, Highlight. For each instance of an Addition or Deletion, you can either Accept or Reject the proposed option. For each instance of Substitutions, you can chose…
(* ACCEPT/REJECT CRITICMARKUP CHANGES
--Stephen Margheim
--23 July 2013
--open source
VERSION 1.1
--added if, then, else blocks for all prompts, allowing for script to function even if not all markup forms are present
--added try block to getContext Handler, allowing script to function when context range exceeds beginning or end of doc
@fractaledmind
fractaledmind / Create New TextMate Note
Created July 24, 2013 04:50
This script prompts you for a Note title and generates a note with that title and opens it in TextMate. This note will reside in a folder on your Desktop called "Pre-Evernote". If you do not have such a folder, the script creates it.
(* CREATE NEW NOTE IN TEXTMATE (FOR EXPORT TO EVERNOTE)
-- created by Stephen Margheim
-- 07 July 2013
-- open source
REQUIRED PROGRAMS:
-- TextMate (I have alternate code for TextEdit as well)
This script prompts you for a Note title and generates a note with that title and opens it in TextMate. This note will reside in a folder on your Desktop called "Pre-Evernote". If you do not have such a folder, the script creates it. Since I create the new note via the Terminal, which requires single word titles, there is a precaution to replace spaces with underscores.
@fractaledmind
fractaledmind / Create New TextMate2 Note
Created July 24, 2013 04:51
This is a fork of my other script to create a new TextMate note. Since the free TextMate2 does not support the "insert" command, I created a work-around using the clipboard.
(* CREATE NEW NOTE IN TEXTMATE (FOR EXPORT TO EVERNOTE)
-- created by Stephen Margheim
-- 07 July 2013
-- open source
REQUIRED PROGRAMS:
-- TextMate (I have alternate code for TextEdit as well)
This script prompts you for a Note title and generates a note with that title and opens it in TextMate2. This note will reside in a folder on your Desktop called "Pre-Evernote". If you do not have such a folder, the script creates it. Since I create the new note via the Terminal, which requires single word titles, there is a precaution to replace spaces with underscores.
@fractaledmind
fractaledmind / Custom URL Handler
Created July 24, 2013 05:07
This script functions as a handler for my custom URL scheme. This is the code, for reference, but in order to the Handler to work properly, it must be a properly formatted App. To download my application, go here: https://www.dropbox.com/s/869ev0kxz6enrhv/URL%20Handler.zip
on run
display dialog "This script applet will respond to webpage links beginning with:" & return & return & "customurl://com.hackademic.AppleScript.URL_Handler?action=1$Path/to/PDF.pdf#" & return & return & "It will open your custom URLs in Skim" buttons {"OK"} default button 1 with title "Custom URL Helper" with icon 1
tell application "Finder" to update (path to me)
end run
on open location this_URL
-- EXTRACT ARGUMENTS
set X to the offset of "?" in this_URL
@fractaledmind
fractaledmind / Create Sources Index in TextMate from BIbDesk
Created August 12, 2013 18:44
REQUIRED PROGRAMS: -- BibDesk -- TextMate (I have alternate code for TextEdit as well) This script automatically generates a list of sources indexed in your BibDesk databases in Markdown format. As I use Evernote to "host" my HTML notes, I also add the relevant MetaData to export the plain text to Evernote via the Markdown2Evernote python script…
tell application "TextMate"
--establish a variable for the line feed (aka LF key)
set LF to ASCII character 10
--insert the MetaData for export to Evernote
insert "# BibDesk Sources Index w/ biblio links" & LF & "= !nbox" & LF & "@ BibDesk, Source List" & LF & LF & LF & "**List of Sources in BibDesk Group**" & LF & LF & LF
--get relevant information from selected items in DEVON
tell application "BibDesk"