Tag Archives | OSX

OS X Finder Service to convert Grab.app TIFF files to JPG

It drives me nuts that Grab.app defaults to .tif as the file type. And no matter how many times I try the recommended :

defaults write com.apple.screencapture type jpg

I can not get it to default to save as a jpg (and I tried jpeg). All I can guess is that this command does not work in 10.6. I don’t know. It drives me nuts.

So I sat down and created a quick OS X Service in Automator that takes files as an input and changes them to jpg. First in automator I selected “Service” as my workflow type

Next, I set the Service receives selected “files or folders” in “any application” values. Then I added the “Change Type of Images” action and set “To Type” to JPEG.

Hit save as “ChangeToJPEG” and now when I right click an annoying .tif, I have an option under Services to ChageToJPG

Grab.app is still annoying, but this makes it more tolerable.

GNU date vs BSD date

I usually develop and test my BASH scripts on my mac, mostly for use on RedHat systems. Occasionally I run into problems with this workflow. Recently I realized there was a differnce between the date command on RedHat and the date command in OS X. Turns out BDS date != GNU date. The workaround, install coreutils from Mac Ports, and add this alias to my .bashrc:

alias date=”/opt/local/bin/gdate”

 

Update: gdate is part of the GNU coreutils, and the MacPorts install command for gdate is: sudo port install coreutils

My mac ports cheat sheet

These 3 commands will check for new ports, upgrade outdated ports, and remove older versions.
  • sudo port selfupdate
  • sudo port upgrade outdated
  • sudo port uninstall inactive

To make sure you have a slimmed down install, use port_cutleaves to remove unnecessary ports. There are often “Build Dependencies” (like autoconf, automake, libtool, m4, help2man, p5-locale-gettext) that are no longer needed after a package is installed.

  • sudo port install port_cutleaves
  • sudo port_cutleaves (I run this a couple of times)

BASH (readline) keyboard shortcuts

I was just in training and the instructor was a command line keyboard shortcut wizard. He was magically making words disappear and reappear. So i fond this list of shortcuts. Many of them did not work in my OS X BASH prompt.I fond I had to go into the terminal.app preferences and select “use option key as meta key” on the keyboard tab (it is at the bottom). Now I can add a few shortcuts to my repertoire.

Powered by WordPress. Designed by WooThemes