Skip to content

Instantly share code, notes, and snippets.

@owahab
owahab / organize.scpt
Created June 20, 2010 07:20
AppleScript to organize your downloads.
(*
organize - hierarchy
This Folder Action handler is triggered whenever items are added to the attached folder.
The script organizes the added files into a folder hierarchy that follows the following structure:
YYYY/M/D
Where YYYY is four-digit year, M is month and D is the day.
Copyright 2010 Omar Abdel-Wahab <owahab@gmail.com>.
You may not incorporate this code into your program(s) without
a written permission from the author but you're free to use it AS IS
@marutanm
marutanm / gist:634174
Created October 19, 2010 13:20
AppleScript: Share on Tumblr
tell application "Safari"
if (count of every document) > 0 then
activate
do JavaScript "javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.tumblr.com/share',l=d.location,e=encodeURIComponent,p='?v=3&u='+e(l.href) +'&t='+e(d.title) +'&s='+e(s),u=f+p;try{if(!/^(.*\\.)?tumblr[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a=function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=450,height=430'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}void(0)" in document 1
end if
end tell
@timvisher
timvisher / gist:787954
Created January 20, 2011 14:25
Script to scale and crop a bunch of wallpapers selected in Finder.app
tell application "Finder" to set wallpapers to selection
tell application "Image Events"
repeat with currentWallpaper in wallpapers
set theWallpaper to open (currentWallpaper as alias)
tell theWallpaper
repeat with dim in [{1920, 1080}, {1280, 800}]
-- Scale and Crop to current dimensions
scale to size (get item 1 of dim)
crop to dimensions dim
@hepplerj
hepplerj / terminallaunch.scpt
Created February 1, 2011 21:56
AppleScript for launching multiple tabbed terminal sessions.
tell application "Terminal"
activate
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down
do script "ssh jheppler@segonku.unl.edu" in the last tab of window 1
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down
do script "ssh jheppler@jetson.unl.edu" in the last tab of window 1
tell application "System Events" to tell process "Terminal.app" to keystroke "t" using command down
@clauswitt
clauswitt / Gist.scpt
Created February 16, 2011 16:21
A short apple script to send contents of the clipboard to gist.github.com (you need to logged in)
tell application "Safari"
activate
open location "http://gist.github.com"
end tell
delay 1
tell application "System Events"
tell process "Safari"
keystroke "v" using {command down}
end tell
end tell
#!/usr/bin/osascript
-- Repeatedly pops a dialog box up in the finder.
tell application "Finder"
repeat
activate
display dialog "You can't make me go away!" with icon 2 buttons {"Oh Fuck"} default button 1
end repeat
end tell
@timvisher
timvisher / gist:971002
Created May 13, 2011 18:01
image scaler that works on the current selection in Finder.app
tell application "Finder" to set wallpapers to selection
set myDimensions to {w169:[{2560, 1440}, {1920, 1080}, {1366, 768}], w1610:[{2560, 1600}, {1920, 1200}, {1440, 900}, {1280, 800}], f43:[{1600, 1200}], s:[{1024, 1024}]}
tell application "Image Events"
repeat with currentWallpaper in wallpapers
set theWallpaper to open (currentWallpaper as alias)
tell theWallpaper
set theWallpaperDimensions to dimensions of theWallpaper
set theWallpaperAspectRatio to (item 1 of theWallpaperDimensions) / (item 2 of theWallpaperDimensions)
@chaptastic
chaptastic / gist:1127738
Created August 5, 2011 15:10
Open in Chrome for Reeder
property theURL : ""
set clipSave to the clipboard
tell application "Reeder"
activate
end tell
tell application "System Events"
keystroke "c" using {shift down, command down}
@sunny
sunny / gist:1216110
Created September 14, 2011 08:33
AppleScript Droplet that adds read/write permissions on all the dropped files and folders
-- "Mal aux droits" droplet
on open the_files
repeat with f in the_files
set f to POSIX path of f
do shell script "sudo chmod -R a+rw " & quoted form of f with administrator privileges
end repeat
end open
@GeorgeWS
GeorgeWS / gist:1258039
Created October 2, 2011 22:12
How I Got My iPad 2
-- USER INPUT
set iPadWifiOr3G to button returned of (display dialog "Choose whether you're looking for a WiFi or a Wifi + 3G iPad." buttons {"WiFi", "WiFi+3G"})
set iPadModel to iPadWifiOr3G
if iPadWifiOr3G contains "WiFi+3G" then
set iPadDataPlan to button returned of (display dialog "Select the carrier you'd like to use." buttons {"AT&T", "Verizon"})
set iPadModel to iPadModel & " " & iPadDataPlan
end if
set iPadColor to button returned of (display dialog "Select the color of iPad you're looking for." buttons {"Black", "White"})
set iPadModel to iPadModel & " " & iPadColor
set iPadStorage to button returned of (display dialog "Select the size of iPad you're looking for." buttons {"16GB", "32GB", "64GB"})