Blog

Code Snippets

Installing things to /usr/bin – Trampolines

Some Mac OS X applications can install useful tools to use with Terminal. PDFKey Prohttp://pdfkey.com is one of those applications. Currently I simply installed a binary called “pdfkeypro” in /usr/bin via a .pkg file. This had the obvious draw back of needing the user upgrade it …

Oops it crashed again (BSCrashNotifier)

hey there,…

BSJobList

Last weekend I wanted to add some kind of list with checkboxes to CuteClips in order to execute a list of tasks… it evolved into BSJobList which is a very easy way to open a window and ask for things that need to be performed. After OK is clicked, all these jobs are executed in t…

How to change your window tags: Camouflage 1.7

New version of Camouflage has just been released today. On of the new things was have the windows not fading out while Exposé is used. To add this functionality is quite interesting, but not so easy when using an undocumented API. This post will show how to use that API and wh…

Making NSTextField REALLY single line

One thing i hate of the NSTextField is that while you can’t use the “enter” key to insert newlines characters you still can insert them, for example, by copying in them text which contains newlines characters. This is plain annoying sometimes! I made this NSFormatter that can be …

Checking invisibility of a file

This NSWorkspace extension add the method “isInvisibleFileAtPath:” to NSWorkspace class. To use it just call that method with a valid pathname you will return a boolean telling you if the file is invisible or not. This method is the union of many partial ways of checking if a fil…

Converting byte sizes into human readable strings

The attached class is an NSFormatter subclass and is useful for taking a size expressed in byte like “2048” and convert it to an human readable string like “2 KB”. It supports unit of measures up to the Terabyte. Note that this class assumes it receives as input an NSNumber or an…