Vincent Gable’s Blog

February 9, 2009

Resolution Independent Screenshots

Filed under: Announcement,MacOSX,Programming | , , , ,
― Vincent Gable on February 9, 2009

Leopard includes technology that generates (mostly) resolution independent screenshots. That means when you enlarge the pictures, they won’t get pixelated, and more importantly, they will stay sharp when printed.

I don’t know if you’ve ever seen a printout of text mixed with a screenshot of text, but it looks like ass. That’s because even a very cheap printer is much higher resolution then your screen. It prints text very sharply. But when it prints the screen shot, it reproduces the low resolution display in high-fedelity — which actually makes it look worse. Plus, computers use tricks (eg sub pixel antialiasing) to make text look sharper on LCD screens — but those tricks can backfire on other media. A screenshot grabs exactly the pixels shown on the screen. And those pixels are optimized to be shown on a screen, not paper.

Example

Here’s an example screenshot (PDF). It looks like this:
Preview.png

If you open it, and zoom in, you will see that the text stays sharp, while some (but not all) of the interface gets pixelated.

PreviewBlownUp.png

How it Was Made

When Automator.app (click to open) saves a workflow, it puts a (mostly) resolution-independent screenshot of the workflow’s UI inside it. The screenshot is at SomeWorkflow.workflow/Contents/QuickLook/Preview.pdf. (In Finder, right-click a .workflow file, and choose “Show Package Contents” to look inside it).

If you print a workflow to a PDF file, it has the same limited resolution-independence. So I suspect Automator.app generates this PDF in much the same way files are printed. I have not investigated why the gray border is vectorized as well as the text. If anyone has an insight there, I’d love to hear it.

In the future, I expect text, and most UI elements, to be represented as vectors at every level of the OS. Screenshots will capture those vector-elements, as as they capture pixel-elements (pixels) today.

January 13, 2009

Automatically Closing NSFW Content (Beta)

Filed under: Announcement,MacOSX | , , ,
― Vincent Gable on January 13, 2009

I’ve finally implemented a neat feature for IMLocation that I’ve wanted to do for a while now, when you arrive at work, it can automagically close NSFW webpages. NSFW content is detected using the same technology behind Mac OS X’s Parental Controls.

I recommend downloading IMLocation to get the full effect, but you can also get just the automator action. Leopard is required, and it only works with Safari right now.

As you guessed, there is a trade-off between accidentally closing important webpages and letting questionable content slip through. I’m not yet sure what the best way to expose tweaking this tradeoff is. In the mean time I’ve chosen the more-confusing-but-powerful road, because I think it’s best to start with something that can do the job, and then refine and simplify it.

Firefox?

I want this to work with Firefox, but I am hamstrung by Firefox’s poor-to-nonexistant AppleScript support. (In the meantime you can try the worksafer Firefox plugin, but it’s not a true substitute).

Firefox is geared towards extension through plugins, while Safari has a less-rich plugin architecture, but good scripting support. Arguably, the Firefox way is better for a web-browser. I’ve seen some really cool Firefox plugins that extend the web-browsing experience in ways a script just can’t. Unfortunately, what I’m trying to do — have NSFW content automatically closed for you when you get to work — is the sort of thing a script does well, and a plugin does cumbersomely, if at all.

If anyone has some advice on how to hack around Firefox’s limitations please drop me a line. Right now my prognosis is “a lot of work for a clunky payoff”, so right now I’m focusing on more pressing concerns.

August 14, 2008

Only Skin Deep…

Filed under: Design,MacOSX | , ,
― Vincent Gable on August 14, 2008

Pictures showing that a nerds desktop can look like other operating-systems … at least from a few feet away.

It’s a good reminder that design is not just skin deep.

July 7, 2008

Programatically Excluding Things from Time Machine Backups

Filed under: Cocoa,MacOSX,Objective-C,Programming,UNIX | , ,
― Vincent Gable on July 7, 2008

To exclude files/folders from a Time Machine backup, you can use the C-function CSBackupSetItemExcluded().

As far as I know there isn’t an official way to do this from the command-line or a shell script. As near as I can tell, the safest way to it without using compiled C-code is:

sudo defaults write /Library/Preferences/com.apple.TimeMachine \
SkipPaths -array-add "PATH-ONE" "PATH-TWO"

where "PATH-ONE" "PATH-TWO" are of course paths to items you want to exclude.

Credit to Ellis Jordan Bojar for this solution. (original article) Using defaults instead of tinkering with .plist files directly is really the way to go!

Powered by WordPress