Skip to content

Instantly share code, notes, and snippets.

View n8henrie's full-sized avatar

Nathan Henrie n8henrie

View GitHub Profile
--Find original post here: http://n8henrie.com/2012/06/converting-openmeta-tags-to-evernote/
-- set theFile to alias “YourHDName:Users:YourUserName:Path:To:TestFile.pdf” –uncomment this line for testing in Applescript Editor!
local importedFrom, targetNotebook, openmeta, tagtext, taglist, tid
--Which notebook do you want the notes to end up in? **Case Sensitive**
set targetNotebook to “Inbox”
--Add a tag to tell what app the files were imported from
set importedFrom to “from_Leap”
--Set openmeta location to wherever you have installed openmeta
set openmeta to “/usr/local/bin/openmeta”
--Get tags as one big string
#!/bin/bash
#relevant post found here: http://n8henrie.com/2013/01/regex-shell-script-to-format-kindle-quotes
tr -s '\r\n' '\t' < "$1" | perl -pe 's|(==========)|\n|g' | grep -Po "\S.*?Highlight\ Loc\.\ .*?$" | perl -pe 's/(.*?)\t- Highlight Loc. .*? (Added on .*?), \d\d:\d\d (A|P)M\t(.*?)\t$/<blockquote>\4<\/blockquote><p>-\1, \2<\/p>\n/g' >"/Users/[username]/Desktop/KindleQuotesFormatted.txt"
# Script posted at: http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
# Script name: Import Pythonista Script from Clipboard
# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
import clipboard
import urllib2
import editor
import os
# Posted at http://n8henrie.com/2013/02/quickly-import-pythonista-scripts-via-textexpander-or-bookmarklet
# Script Name: Import Pythonista Script from Bookmarklet
# I got help from here: http://twolivesleft.com/Codea/Talk/discussion/1652/what-others-do%3A-pythonista/p1
# I got help from here: http://www.macdrifter.com/2012/09/pythonista-trick-url-to-markdown.html
# I got help from here: http://www.macstories.net/tutorials/from-instapaper-and-pythonista-to-dropbox-and-evernote-as-pdf/
import sys
import urllib2
import editor
--Relevant post here: http://n8henrie.com/2011/06/dropvox-dropbox-hazel-and-omnifocus/
tell application “Finder”
set file_name to (name of theFile)
tell application “OmniFocus”
tell default document
set NewTask to make new inbox task with properties {name:file_name}
tell the note of NewTask
make new file attachment with properties {file name:theFile, embedded:true}
end tell
activate
# Original post at http://n8henrie.com/2012/12/droplet-to-remove-gps-data-from-photos-with-exiftool/
exiftool -a -gps:all= /Path/To/Image.JPG
due://x-callback-url/add?title={{drafts:///create?text=[[draft]]&action=Message}}&x-source=Drafts&x-success=drafts://
--Originally posted at http://n8henrie.com/2013/02/how-to-test-hazel-applescripts-in-applescript-editor
-- uncomment below for testing Noodlesoft Hazel script in Applescript Editor
(*
property theFile : alias "Path:To:Your File.extension"
hazelProcessFile(theFile)
*)
on hazelProcessFile(theFile)
--Your external Hazel script goes here.
--Alternatively, just use the "property theFile :" line at the top for testing scripts to be embedded.
#original post at http://n8henrie.com/2012/08/copy-pictures-from-iphone-to-mac-with-terminal-and-ssh/
scp -r -i ~/.ssh/mykey_id_rsa root@iphonebonjourname.local:/User/Media/DCIM /Users/[username]/Desktop/%Y%m%d\ Phone\ Pics/
-- You must have UI scripting enabled for this to work.
-- Originally written by Nathan Henrie Sep 07, 2012
-- Originally posted at http://n8henrie.com/2012/09/applescript-to-automate-checking-checkboxes-in-your-web-browser/
display dialog "This script will try to simulate manually ticking off checkboxes in a web browser using \"tab\" and \"spacebar\" clicks. It seems to be working okay in the most recent stable versions of Safari and Chrome as of Sep 07, 2012. That said, you could unintentionally submit a form or otherwise screw something up, so please don't use it on anything important." & return & return & "Click \"Cancel\" below to exit the script, or \"OK\" to assume all risk for use of the script." with title "Disclaimer: USE AT YOUR OWN RISK"
tell application "Finder" to set RunningProcesses to name of every process
set numberBoxes to 0
set numberBoxes to text returned of (display dialog "Guess LOW! You can run this script again if it wasn't enough, but too much and you may accidentally click somethi