Skip to content

Instantly share code, notes, and snippets.

@Zettt
Zettt / label finder items.applescript
Last active December 3, 2024 11:01
Set Color Label for selected Finder items
(*
No color = 0
Orange = 1
Red = 2
Yellow = 3
Blue = 4
Purple = 5
Green = 6
Gray = 7
*)
@Zettt
Zettt / Search DuckDuckGo in Google Chrome.py
Created November 23, 2012 18:01
Search DuckDuckGo in Google Chrome for iOS
import webbrowser
import urllib
# http://duckduckgo.com/?q=asdf
ddg_url = "googlechromes://duckduckgo.com/?"
query_url = "q="
# input
prompt = "> "
query = raw_input("Query: \n" + prompt)
@Zettt
Zettt / New OmniFocus Task.py
Created November 23, 2012 17:59
New OmniFocus Task
import webbrowser
import urllib
# omnifocus:///add?name=[prompt]&note=[prompt]
omnifocus_url = "omnifocus:///add?"
task_name_url = "name="
note_url = "note="
# input
prompt = "> "
@Zettt
Zettt / Daily Diary.py
Created November 19, 2012 19:28
Daily Diary in Python for Pythonista ( Original post: http://tmblr.co/ZFavEyXHGqSe )
import webbrowser
import urllib
dayone_url = "dayone://post?entry="
feeling_question = "How do you feel today?"
achievement_question = "What are you trying to achieve today?"
thought_question = "Is there a negative thought or positive on your mind you want to get out?"
tag = "#diary"
# input
@Zettt
Zettt / #nowplaying.applescript
Created November 8, 2012 11:31
AppleScript that gets currently playing track with title and name and whatnot and returns it only if iTunes is running. Useful for TextExpander snippets. (Include in optional section)
tell application "System Events"
if not (exists process "iTunes") then return
end tell
tell application "iTunes"
tell playlist "Rating = 5"
set trackCount to count of tracks
set randomTrackNumber to random number from 1 to trackCount
set trackTitle to name of track randomTrackNumber
set trackArtist to artist of track randomTrackNumber
@Zettt
Zettt / Add to Reading List.applescript
Created October 7, 2012 14:37
Add links from Mail to Safari Reading List
(*
Add to Reading List
Script for Apple Mail to find http and https links in emails and add them to Safari's Reading List automatically.
Best practice: setup with "any recipient contains '+reading'". Actions "mark as read", "execute AppleScript", "delete message", "stop evaluating rules"
Created by Andreas Zeitler on 2012-10-07
Mac OS X Screencasts. www.macosxscreencasts.com
*)
@Zettt
Zettt / xmpScript.applescript
Created December 9, 2011 14:08
Use xmp to convert DMF files to WAV
set channelNumbers to 12
set fileName to "/Users/you/Projects/SONGNAME"
set nr to 1
set extension to ".WAV"
set dmfFileName to "'/Users/you/Projects/SONGNAME.DMF'"
repeat while nr ≤ channelNumbers
-- display dialog nr
@Zettt
Zettt / dayprojects.applescript
Last active December 3, 2024 11:02
Day Projects for OmniFocus
-- Day Projects
--
-- Created by Zettt on 2011-11-28
-- Mac OS X Screencasts.
--
-- This script creates "Day Projects" in OmniFocus.
--
-- I use these "Day Projects" to put stuff, that I need to
-- do on a specific day, but aren't big enough to be their own project.
-- Things like "Call the doctor on Wednesday" or
@Zettt
Zettt / idioms.rb
Created November 11, 2011 12:05
Show random idiom on desktop using GeekTool
srand # seed random
require 'csv'
wordArray = Array.new
definitionArray = Array.new
if File.exists?("/Users/zettt/Archive/Vocab/idioms.csv")
CSV.open('/Users/zettt/Archive/Vocab/idioms.csv', 'r') do |row|
# p row[1]
@Zettt
Zettt / Extract Icons Service.sh
Created September 15, 2011 14:43
Extract icons from apps with a service. Add Filter Finder Items action (Kind:Apps) and Run Shell Script action with the following script.
mkdir $HOME/Desktop/AppIcons/
for CURRENTAPP in "$@"; do
APPDIR="$1"
ICON=`defaults read "$APPDIR/Contents/Info" CFBundleIconFile|sed -e 's/\.icns$//'`
ICONFILE="$APPDIR/Contents/Resources/$ICON.icns"
APPNAME=`basename "$APPDIR" .app`
OUTFILE="$HOME/Desktop/AppIcons/${APPNAME}.icns"
cp -f "$ICONFILE" "$OUTFILE"
shift