Note: there’s an updated version of this script.
I often download huge files that I only need temporarily, things like installer packages and disk images. They end up on my desktop because that is my download folder and quite often they also end up in the Time Machine backup, wasting a lot of space there.
I wanted a contextual menu command to exclude these files from the backup in the Finder so I wrote this AppleScript:
on main(filelist)
set target to quoted form of (POSIX path of (item 1 of filelist as alias))
do shell script "xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd " & target
end main
It adds extended attributes to the file telling Time Machine to ignore it. I got this information from an excellent article about Time Machine.
To run the script as contextual menu in the Finder I use Ranchero Software’s free Big Cat utility. After installing that and storing my script in $HOME/Library/Application Support/Big Cat Scripts/Files, I have a new entry in the Finder contextual menu for files:

The only problem is that custom contextual menu items are in a “More” submenu on Leopard, which moves the Big Cat scripts down to the inconvenient third level.
OpenMenu X looks good, I didn't know that. I'll try it out to see if it's worth its price...
|



'The only problem is that custom contextual menu items are in a "More" submenu on Leopard,
which moves the Big Cat scripts down to the inconvenient third level.'
Maybe this can be changed by using OpenMenu X? Just a thought.
http://www.artman21.com/en/openmenu_x/