Skip to content

Instantly share code, notes, and snippets.

View brandonpittman's full-sized avatar

Brandon Pittman brandonpittman

View GitHub Profile
@brandonpittman
brandonpittman / StickyBox.applescript
Last active December 17, 2015 09:59
This is an AppleScript to check OmniFocus' Inbox and notifies you if the "taskCount" has been exceeded using Sticky Notifications.app.
(*
Please change your folder and project names to whatever you use in OmniFocus. I have the acceptable task count at 1 but change this to whatever you feel comfortable with.
Author: Brandon Pittman
URL: http://brandonpittman.net
*)
set taskCount to 1
tell application "OmniFocus"
@brandonpittman
brandonpittman / CD2DIR.applescript
Last active July 6, 2019 09:25
AppleScript to switch to the current Finder directory while navigating the command line. Run as a TextExpander snippet (set to "AppleScript") for maximum utility.
tell application "System Events"
tell process "Finder"
if window 1 exists then
tell application "Finder"
set thePath to get quoted form of POSIX path of (target of front Finder window as text)
return "cd " & thePath & return
end tell
else
display alert "Finder doesn't have a window open." as warning giving up after 2
end if
@brandonpittman
brandonpittman / EvernoteTitlePrepend.applescript
Last active December 17, 2015 16:49
This script will let you append text to the selected notes in Evernote.
tell application "System Events"
set the_dialog to display dialog "What would you like to prepend to the selected notes?" default answer ""
set prepend_text to text returned of the_dialog
end tell
tell application "Evernote"
@brandonpittman
brandonpittman / EvernoteTitleAppend.applescript
Last active August 8, 2016 20:21
This AppleScript will append text to the title of the selected notes in Evernote.
tell application "System Events"
set the_dialog to display dialog "What would you like to append to the selected notes?" default answer ""
set append_text to text returned of the_dialog
end tell
tell application "Evernote"
@brandonpittman
brandonpittman / UpdateBrew.sh
Last active December 18, 2015 21:28
Update Homebrew formulae, software and Ruby gems.
#!/bin/bash
/usr/local/bin/brew upgrade
/usr/local/bin/brew update
~/.rvm/rubies/ruby-head/bin/gem update
~/.rvm/rubies/ruby-head/bin/gem update --system
/usr/local/bin/npm update
tell application "System Events"
set new_name to text returned of (display dialog "Rename this file to..." default answer "" with title "Rename File" with icon POSIX file "/Applications/BBEdit.app/Contents/Resources/BBEditApplication.icns")
end tell
tell application "BBEdit"
set theFile to file of front document
end tell
tell application "Finder"
set ext to "." & name extension of file theFile
@brandonpittman
brandonpittman / EvernoteBatchRename.applescript
Last active March 30, 2021 07:49
Batch Rename Evernote Notes
tell application "Evernote"
set the_notes to selection
set the_dialog to display dialog "What would you like to title these notes?" default answer ""
set the_title to text returned of the_dialog
set the_count to 1
@brandonpittman
brandonpittman / FindUntitledEvergrams.applescript
Last active December 20, 2015 07:49
Search Evernote for photos tagged "instagram" and are titled Untitled. Useful for forcing you to title photos automatically imported from Instagram to Evernote using IFTTT.
tell application "Evernote"
set instagram_photos to find notes "tag:instagram intitle:Untitled"
repeat with photo_title in instagram_photos
open note window with photo_title
end repeat
end tell
@brandonpittman
brandonpittman / Dayfile2DayOne.sh
Last active December 20, 2015 08:09
Sends dayfiles, weekfiles, and monthfiles to DayOne for logging.
#!/bin/bash
# I use an elaborate system of "dayfile-#{date}" along with monthfile and
# weekfile to track my goals. I then log them in Day One.
# Sets the time you want to do the logging at. The "10#" prevents the shell from lopping off leading 0s."
let cutoff="10#$(date +"%H%M")"
if (($cutoff > 2349))
then
@brandonpittman
brandonpittman / Coin_Find_Watched_Regex
Created August 15, 2013 00:58
This is a regular expression to find "Watched" movies in Coin.rb's JSON database.
"\d{1,9}":\{"title":"[A-Za-z \d:\.\&]+","rating":\d\.\d,"tmdb_id":\d{1,9},"released":"\d{4}-\d{2}-\d{2}","watched":"\d{4}-\d{2}-\d{2} \d{2}:\d{2}"\}