Skip to content

Instantly share code, notes, and snippets.

@DrLulz
DrLulz / skim-to-evernote.scpt
Created December 12, 2014 01:59
Export Skim annotations to Evernote. Requires Hackademic's "Skimmer URL Handler" (https://gist.github.com/smargh/10218589)
property line_feed : (ASCII character 10)
property md_line_feed : (ASCII character 32) & (ASCII character 32) & (ASCII character 10)
property as_delims : AppleScript's text item delimiters
property export_style : "HTML"
property export_destination : "Evernote"
--Text Note HTML
property text_prefix : "<p style=\"font-size: 14px;\">"
property text_body_wrap_front : "<span style=\"font-family: 'Helvetica Neue';\">"
@DrLulz
DrLulz / skim-to-omnioutliner.scpt
Created December 12, 2014 02:00
Idea taken from The Hackademic's Export Skim Notes to Evernote (http://hackademic.postach.io/export-all-skim-notes-directly-to-evernote). It requires the user to annotate pdf's in Skim using the designated favorite colors (http://www.alfredforum.com/topic/4052-skimmer-pdf-actions-for-skim/page-3#entry27286). After export it places a link in the …
tell application "System Events"
if not (exists process "OmniOutliner") then
do shell script "open -a \"OmniOutliner\""
end if
end tell
tell application "Skim"
set all_notes to every note of front document
set pdf_name to (name of front document)
@DrLulz
DrLulz / paste-to-OO-as-titlecase.scpt
Last active August 29, 2015 14:13
Copies selected text, converts to titlecase, and then pastes into OmniOutliner as new row. Comment out line 16 to keep focus on document from which text originates. Change "txt_capped" to "txt" on line 18 to disable titlecase convert. Use Alfred or other manager to link script to hotkey.
tell application "System Events" to keystroke "c" using {command down}
-- if OO document is minimized unminimize
tell application id "com.omnigroup.OmniOutliner4"
if miniaturized of front window is true then
set miniaturized of front window to false
end if
end tell
-- send clipboard text to handler
@DrLulz
DrLulz / merge-rows-OO.scpt
Last active August 29, 2015 14:13
Merge selected rows in OmniOutliner. Copies selected rows below the first into the first then deletes copied rows.
tell front document of application "OmniOutliner"
if (count of selected rows) < 2 then
display dialog "Select rows to merge." buttons "Cancel" default button "Cancel"
end if
set row_start to (index of first selected row) --skip non-selected rows
set row_end to (index of last selected row) --record last row for deletion
repeat with n from 1 to (count of selected rows) --# of rows selected
@DrLulz
DrLulz / skim-2-oo4.scpt
Created January 12, 2015 00:48
Creates OmniOutliner document with hierarchy based on color of Skim highlights.
tell application "System Events"
if not (exists process "OmniOutliner") then
do shell script "open -a \"OmniOutliner\""
end if
end tell
tell application "Skim"
set all_notes to every note of front document
set pdf_name to (name of front document)
@DrLulz
DrLulz / search.py
Created January 20, 2015 16:53
Search text of all PDFs in a folder.
#!/usr/bin/python
import sys;
import re;
import slate;
import pickle;
import nltk;
import glob;
import os;
@DrLulz
DrLulz / en_xml.scpt
Created January 25, 2015 07:10
Create XML from Evernote Notes
on run argv
set query to argv as text
set final_list to {}
tell application id "com.evernote.Evernote"
set notebook_list to every notebook
set compiled_list to {}
repeat with book_ in notebook_list
set book_name to {its name}
set note_list to every note of book_
@DrLulz
DrLulz / oo-search.scpt
Created January 27, 2015 19:15
Search OmniOutliner front document. Select all rows which match the query and collapse all rows which don't.
set query to the text returned of (display dialog "Enter Your Search Term" default answer "QUERY" with title "Search OmniOutliner Front Document" with icon path to resource "OmniOutliner.icns" in bundle (path to application "OmniOutliner"))
tell application id "OOut"
try
set doc_name to name of front document
on error
activate
display dialog "No Document Open"
end try
on run argv
set query to argv as text
tell application "Skim"
set matches to {}
set pg_hz to {}
set pg_nums to {}
<snippet>
<content><![CDATA[
{{tll
| title = ${1}
| subtitle = ${2}
| tip = ${3}
| body = ${4}
| icon = ${5}
| color = ${6}
}}