Archive for April, 2008

Apr 03 2008

Change Screenshot File Type

Published by john under Defaults

Over here I wrote about how to change the path where screenshots are stored. Another potentially handy option is to specify what file format you prefer for your screenshots. There is a surprisingly large number of choices: png, pdf, tiff, pict, jpg, bmp, gif, psd (PhotoShop), sgi (Silicon Graphics) and tga (Truevision targa).

You can change the file type by running the following defaults command from a terminal, where ‘format’ is one of the options above:

defaults write com.apple.screencapture type format

Logout/login for the new file type to take effect. As an alternative, you can run the following command from a terminal, however, I had problems getting this to work on a consistent basis:

killall SystemUIServer

You can also use the Property List Editor to set the your screencapture preferences. The file you need to open is located here: ~/Library/Preferences/com.apple.screencapture.plist (use Finder to locate the file and double click to open).

Technorati Tags: ,

No responses yet

Apr 02 2008

NetBeans 6.1, Ruby and AppleScript

Published by john under Tools/Utilities

What do NetBeans, Ruby and AppleScript have in common? There’s a circular definition of sorts to explain…to start, all are tools available to developers working on Mac. Next, NetBeans has full support for creating, debugging and packaging Ruby code. And finally, Ruby (with the right tools in place) can be used within NetBeans to control scriptable applications on a Mac, something which is typically accomplished using AppleScript.

In this post I’ll describe more about how all these tools come together to provide an interesting approach for using Ruby as an alternative to AppleScript, and working with NetBeans as the development environment for writing and building those same applications.

The screencast that follows will walk you through all the steps to download the tools you’ll need, build from source a scripting bridge (rb-appscript) for Ruby to AppleScript, and finally, create several short examples to demonstrate how you can use Ruby, from within NetBeans to control scriptable applications.

For more information, follow these links:

If you are interested to learn more about using Ruby as an alternative to AppleScript, I’ve written as series of posts you can find here: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6

If you write an interesting application in NetBeans, using Ruby and rb-appscript, drop me a note, as I’d like to post several good examples showing the interaction of all these tools.

As an aside, NetBeans is sponsoring a blogging contest for the 6.1 Beta. If you are interested in learning more, visit the NetBeans Blogging Contest. And who knows, you could walk away with one of ten $500 American Express gift certificates!

Technorati Tags: , , , ,

No responses yet

Apr 01 2008

Change Screenshot Path

Published by john under Defaults

No question, screenshots are your friend. There is a wealth of options for capturing screenshots on a Mac, with the two most common being Shift-Command-3 (entire screen) and Shift-Command-4 (area you specify with mouse). I like to have all images I capture/edit in a specific directory, the same directory that my ftp client points to upon startup.

Here is a defaults command (run from a terminal) that you can use to specify the location where to store screenshots:

defaults write com.apple.screencapture location path

The path setting must truly be the full path, that is, you cannot reference ~ for your home directory. If you would like to place screenshots in reference to your home directory, simply use the full path, such as /Users/John/Desktop/screenshots.

For the new path to take effect your best bet is to logout/login. I’ve seen references to the following command as an alternative, however, this didn’t work consistently for me:

killall SystemUIServer

You can also use the Property List Editor to set the your screencapture preferences. The file you need to edit is located here: ~/Library/Preferences/com.apple.screencapture.plist (use Finder to locate the file and double click to open).

Technorati Tags: ,

One response so far

« Prev