AppleScripts

AppleScripts

http://en.wikipedia.org/wiki/AppleScript

Apple Script is the built-in scripting language of Mac OS. It has been around since the days of System 7, and it's still very useful today. Applications can make their functions scriptable, so you can do really powerful things, moving data from app to app, processing it along the way. These are some useful scripts I've made for various tasks.

Safari New Window

Put this script in your dock in place of Safari. It has Safari's icon copied to it already. When you click on it, it will open a new Safari window on top of any existing open windows. It will open the window in whichever "Space"/"Desktop" you are currently in, without switching to other desktops.

Download Source Code

SpamCop Assist

SpamCop Assist is an Apple Mail helper script that automatically copies the raw source of the currently selected email to the clipboard, then mark that mail as Junk, and move it to the junk mail folder. This lets you easily and quickly paste that source into SpamCop.net to report it. Place this script in the Mail scripts folder, ~/Library/Scripts/Applications/Mail/

Download Source Code

Split File

This script lets you split up text based files into multiple files, based on how many lines you want. It uses the `split` command line tool, but all you have to do is drop a text file on to it, and answer the questions in the dialog windows.

Download Source Code

Compress Folder

Drop a file or folder on to this script, choose GZip or BZip2, and this script will tar and compress the folder. You can also double click the script and choose a folder. Files only work when you drag them into the applet. Makes .tgz or .tbz archives.

Download Source Code

Image Folder

This applet is somewhat similar to the 'Compress Folder' script above. You drag a folder on to this script and it makes a compressed disk image of the folder. You can also double click and choose a folder. Disk image is created in the same folder as the original.

Download Source Code

Identify File

This applet uses the unix command `file` to read through a file and determine what kind of file it is. the `file` command is built into OS X so you don't need to install anything. Just drag a file on to this applet or double click it.

Download Source Code