Skip to content

Instantly share code, notes, and snippets.

View derickfay's full-sized avatar

Derick Fay derickfay

View GitHub Profile
-- original by Stephen Margheim
-- edited to write the clipboard by Derick Fay, 29 Aug 2013
-- edited to change link format to Cite Key Title
--establish a variable for the line feed (aka LF key)
set LF to ASCII character 10
--insert the MetaData for export to Evernote
set theText to "# BibDesk Sources Index w/ biblio links" & LF & "= !nbox" & LF & "@ BibDesk, Source List" & LF & LF & LF & "**List of Sources in BibDesk Group**" & LF & LF & LF
@derickfay
derickfay / Export All Skim Notes with Markdown Reference Links to Clipboard
Last active December 22, 2015 00:08 — forked from fractaledmind/Export All Skim Notes with Markdown Reference Links
Avoids editor-specific dependency by copying notes to the clipboard rather than adding to a file.
@derickfay
derickfay / Place Markdown Link of BibDesk Item on Clipboard
Last active October 17, 2021 19:56 — forked from fractaledmind/Insert Markdown Link of BibDesk Item into TextMate
Copies to clipboard to remove dependency on a particular editor. Displays Cite Key as well as Title in selection dialog.
@derickfay
derickfay / stripHomeDir.applescript
Last active December 22, 2015 08:29
Strip the user home directory from a filename in Applescript
tell application "Skim"
set theFile to file of document 1 as string
set theHome to path to home folder as string
set theFilePath to my replaceText(theHome, "", theFile)
end tell
on replaceText(find, replace, someText)
set prevTIDs to text item delimiters of AppleScript
@derickfay
derickfay / BibDesk-MavericksTags.scpt
Last active January 26, 2016 17:13
Adds the Keywords from the current selection in BibDesk to all linked files as Mavericks tags.
set plistFront to "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><array>"
set plistEnd to "</array></plist>"
(* By Derick Fay, 2013-10-28 *)
(* Thanks to http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this for getting me started *)
tell application "BibDesk"
-- without document, there is no selection, so nothing to do
if (count of documents) = 0 then
@derickfay
derickfay / MergeAllFinderWindows
Last active February 18, 2021 01:39
Merge all Finder windows - uses UI Applescript to execute the Finder menu command. There's a more error-proof version (not mine) in an Alfred workflow here: http://www.alfredforum.com/topic/3363-mavericks-merge-all-finder-windows/
tell application "System Events"
click menu item "Merge All Windows" of menu "Window" of menu bar item "Window" of menu bar 1 of application process "Finder" of application "System Events"
end tell
@derickfay
derickfay / New rtfs with citations.scpt
Created January 31, 2014 19:10
Export BibDesk citations as individual rtf files
set theFolder to POSIX path of (choose folder with prompt "Choose target folder for new documents:")
tell application "BibDesk"
set thePubs to selection of document 1
repeat with thePub in thePubs
set filename to (theFolder as string) & (cite key of thePub as string) & ".rtf"
export document 1 using template "Template" to filename for thePub --insert your template name here
end repeat
end tell
@derickfay
derickfay / tpsort.py
Created February 8, 2014 22:10
Python script to sort text by the dates in @Due(YYYY-MM-DD) tags. Made for use with TaskPaper files.
#!/usr/bin/env python
import re
import sys
# first & only argument is the text to be parsed
theText = sys.argv[1]
theList=[]
j=""
@derickfay
derickfay / tp2fantastical
Last active August 20, 2016 13:57
Sends the input text to Fantastical, converting TaskPaper @Due(YYYY-MM-DD) tags to plain text for Fantastical to parse as a Reminder. Designed for use with Drafts and Pythonista.
# tp2fantastical
#
# by Derick Fay, 2014-04-06
#
# an adaptation of the Selection to Fantastical Editorial workflow
# (http://editorial-app.appspot.com/workflow/6172238982152192/Y3VYajI3Hzc )
# for use with Drafts and Pythonista (both required)
#
# works on iPhone and iPad
# I have also written an equivalent script for TaskPaper for the Mac