Skip to content

Instantly share code, notes, and snippets.

View bachya's full-sized avatar

Aaron Bach bachya

View GitHub Profile
@bachya
bachya / Dynamic Markdown Links from Chrome.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Chrome and returns a Markdown link with the current title and URL.
@bachya
bachya / Save Files to Evernote.scpt
Created September 5, 2014 05:20
Smarter saving of files to Evernote (regardless of whether Evernote is open)
(*
### SCRIPT NAME
Save Files to Evernote (via Hazel)
### DESCRIPTION
Allows for smarter document creation on OS X: if Evernote is running, use
Applescript to add the document; otherwise, use the user's Evernote
email address.
@bachya
bachya / Smart OmniFocus Entry.scpt
Created September 5, 2014 05:23
Smart Applescript that allows tasks to be entered into OmniFocus, even if it's not open
-- Determine whether OmniFocus is running.
tell application "System Events"
set omnifocusActive to count (every process whose name is "OmniFocus")
end tell
if omnifocusActive > 0 then
-- OmniFocus is running, so insert a task into it directly.
tell application "OmniFocus" to tell document 1
make new inbox task with properties {name:"TASK TITLE"}
end tell
(*
### SCRIPT NAME
OmniFocus+
### DESCRIPTION
Allows for smarter task entry on OS X: if OmniFocus is running, use
Applescript to add the task; otherwise, use the user's Mail Drop
email address.
(*
### SCRIPT NAME
Add Emails to OmniFocus
### DESCRIPTION
A simple script aimed at working with "todo" emails. The script
accomplishes two things:
(*
### SCRIPT NAME
Send nvALT Checkboxes to Omnifocus
### DESCRIPTION
Automatically scans nvALT files (via Hazel) and, upon finding "checkboxes,"
sends them to OmniFocus as tasks.
@bachya
bachya / Add File to Evernote.scpt
Created September 5, 2014 05:28
Simple Applescript to add a file to Evernote
tell application "Evernote"
activate
create note from file theFile notebook {"Personal Archive"} tags {"receipt/statement"}
end tell
@bachya
bachya / Save nvALT Checkboxes to OmniFocus.scpt
Created September 5, 2014 05:33
Applescript to save `[ x ]` symbols in nvALT as OmniFocus tasks
on hazelProcessFile(theFile)
set p to POSIX path of theFile
set l to paragraphs of (do shell script "grep '\[ x \]' " & quoted form of p)
tell application "OmniFocus" to tell document 1
repeat with v in l
set taskName to (do shell script "n="" & v & ""; echo ${n:6}")
set taskNote to "Created from nvALT: nvalt://find/" & my encode_text(my remove_extension(my basename(p)), true, false)
make new inbox task with properties {name:taskName, note:taskNote}
end repeat
@bachya
bachya / bp.sh
Created September 5, 2014 05:43
Shell script to create a new blog post (via Geeknote and vim)
bp () {
if [ "$#" -ne 0 ] || [ "$1" = "-h" ] || [ "$1" = "–help" ]
then
echo "Usage: $0" >&2
return 1
fi
# Fill these out with values you like.
local tag_string=“draft”
local notebook=“Sentinote”
@bachya
bachya / Receipts in Evernote.scpt
Created September 5, 2014 06:02
A slightly modified version of https://gist.github.com/bachya/4f861098e52f95cbee22 (for receipts in Evernote)
tell application "Evernote"
activate
create note from file theFile notebook {"Personal"} tags {"receipt/statement"}
end tell