February 22, 2012

Toggle display of hidden files in Finder with Automator (OSX)

Do you find yourself needing to toggle the display of hidden files in Mac OSX?  Yeah, me too.   For us web developers this can often be to edit .htaccess files.

For reference here is the code:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Don’t get me wrong, playing in Terminal is sublime geekiness but still something I wish was easier.  Say, with a keyboard command or mouse click.

This is where Automator comes in.  Automator is a way in OSX to, as you might guess, automate tasks.

User madgunde over at Art of Geek put together a great article on how to create an Automator script to add a services menu option for all Finder windows.  This makes is very convenient to with just a click to switch the display of hidden files.  And it is more graceful than using the KillAll Terminal command.

Head over to Art of Geek for the full article.

Making the most out of Dropbox with symlinks

Dropbox is great.  It is a folder where you can drop your files and have them sync into the cloud securely and sync them with any computers you want.

I primarily use this for syncing my MacOS keychains between my Mac Pro and Macbook Pro.   This in combination with MobileMe ensures that almost everything is kept in sync between computers.

While I do use Back to my Mac to access my files on the Mac Pro while I am away, I have found it to be somewhat unreliable.  For no reason it will periodically become unavailable and will show an error that it cannot map the correct port.  This is odd because there are no other machines that should use that port (4500) on the network (I will go over port mapping and IP reservations in another post).

With that in mind and other potential issues which could cause my Mac Pro to be unavailable I set out to see if I could further leverage Dropbox.  So not only did I want to sync my preferences and passwords, but project files as well.  It probably isn’t feasible for me to back up everything but current projects should do.

I have my projects folder located on the same drive as my Dropbox folder, which is 2 500gig drives in a software RAID mirror for redundancy (and my entire system is backed up to a Drobo).  My folder structure was established prior to getting Dropbox and I sure don’t want to move things around now… plus that would mean that I would far exceed what my Dropbox account can handle.

In comes symlinks (or Symbolic Links).  Symlinks are much like Mac OS aliases with a few key differences.  For instance, if you move the folder the symlink points to, your symlink will no longer work properly.  And while symlinks are compatible with pretty much any UNIX operating system they don’t play nice with Classic (don’t know that this is really a problem for anyone these days).   For our purposes symlinks are a perfect way to maintain our existing file structure and leverage Dropbox in the process.

You could fire up Terminal and create symlinks the old fashioned way (more info here)…. or you could do what I did and install SymbolicLinker. SymbolicLinker provides a nice system-wide way of quickly creating symbolic links via the context-menu in OSX.

Screen shot 2009-11-17 at 8.46.52 AM

Just right-click (or control-click) the folder (works best with folders not individual files) then hit the option to create a symbolic link.  This works and looks just like an alias in OSX.  Just copy this over to your Dropbox folder and you are good to go!

Clean up Finder’s “Open With” menu

Recently VLC started showing up twice in my “Open With” menu in OSX Snow Leopard.  In fact one of the links didn’t even work so I wanted to clean it up.

This of course wouldn’t just apply to VLC, other apps can cause it as well.  This list is built over time based upon the programs you open.  A duplicate on this list might just reference an old version of a program.

Just open up your hard drive open your USER/Library/Preferences and delete the file”com.apple.LaunchServices”.  Not to worry, this won’t hurt anything.  But if you are feeling nervous just back up the file somewhere.

Once you have trashed it, check out your menu, things should be reset.

Snow Leopard, Quicktime 7, and the new Quicktime X

So you upgraded to Snow Leopard?  I did the day it came out, and it is a great release.  So far I have found it very stable and it didn’t take long for the updates to the applications I use to flow in.  In fact, many vendors had beta versions ahead of the release which made the transition easier.

One thing you might have discovered if you are a user of Quicktime Pro, is that things are not quite the way they used to be.  The new Quicktime in Snow Leopard is completely new from the ground up.  So things you might be used to, like an export feature, are missing in action.  If you are shaking your fists angrily in the general direction of Cupertino, fret not.  Apple has included a copy of Quicktime 7 in your utilities (applications/utilities) folder automatically if you previously had Quicktime Pro installed.  Don’t have it installed yet?  Well then follow the instructions here.

WTF?

Indeed. What was Apple thinking??  I pondered this initially but when you dig a bit deeper the reasoning becomes clear(er).  Quicktime X is something very different.  It is no longer a aging legacy media tool with roots from way back in 1991.  This is something coded from the ground up to sing in OSX.

John Siracusa covers its difficiencies quite well in his article on arstechnica.com.  See here and here for coverage of Quicktime 7 and Quicktime X.

Unfortunately, the list of things you can’t do with the new QuickTime Player is quite long. You can’t cut, copy, and paste arbitrary portions of a movie (trimming only affects the ends); you can’t extract or delete individual tracks or overlay one track onto another (optionally scaling to fit); you can’t export a movie by choosing from the full set of available QuickTime audio and video codecs. All of these things were possible with the old QuickTime Player—if, that is, you paid the $30 for a QuickTime Pro license. In the past, I’ve described this extra fee as “criminally stupid”, but the features it enabled in QuickTime Player were really useful.

But if you can get past these limitations (and use Quicktime 7 for your video editing/transcoding) there are some good things to like in Quicktime X.  For example you can now record your screen or upload videos directly to YouTube and MobileMe, email them or even import them into iTunes.  In the end Quicktime X represents a big step forward for media playback in OSX.

Like it or not, it’s here to stay.  Thankfully, so is Quicktime 7.  I highly recommend reading John’s article through.  It will shed some light on that $29 upgrade why it included exactly “0 new features”.

Screen shot 2009-10-29 at 10.23.12 PM

Fluid application changes the way you work with web apps

I just downloaded and started using Fluid.  This application lets you wrap your web applications into a Cocoa desktop application also known as an  SSB (site-specific browser). This is cool for a number of reasons but most importantly your workflow.  I have been wanting something like this for a while now because I find there are a number of web apps I lose between the dozen or so tabs I have open at any one time.  Since they are tabs which could be in one of many open windows it is easy for them to get lost.  They just aren’t handled like system-level applications.  So the introduction of Fluid changes all of that.  You can Command-Tab between your web apps, keep them in your Dock, and apparently there is support for 1Password as well.

I think the description on their site sums up the way this works pretty well.

…Site Specific Browsers (SSBs) provide a great solution for your WebApp woes. Using Fluid, you can create SSBs to run each of your favorite WebApps as a separate Cocoa desktop application. Fluid gives any WebApp a home on your Mac OS X desktop complete with Dock icon, standard menu bar, logical separation from your other web browsing activity, and many, manyother goodies.

Fluid includes Tabbed Browsing, built-in Userscripting (aka Greasemonkey), URL pattern matching for browsing whitelists and blacklists, bookmarks, auto-software updates via the Sparkle Update framework, custom SSB icons, a JavaScript API for showing Dock badges, Growl notifications, and Dock menu items, and more.

One thing you will likely have to contend with (and has been driving me nuts) is how to get a decent icon for your Dock.  The application gives you the option to use the one on the site (the favicon) or to define your own (something on your hard drive).  I haven’t had any luck really with the icon from site option so I opted to create my own.  Now what you can do is grab the favicon (if it’s a decent one) then head over to iConvertIcons.  Using their free wizard you can quickly convert any image or the favicon.ico file into a Mac-friendly icns file.  Once you have done this and saved the output to your system you can then create a new Fluid application and point to your new icon.  It took me a few tries to get some of the more difficult ones to work, but in the end it is well worth it.

You can also use any icons you may already have on your system if you prefer that route.   Give it a shot, I think this is a keeper for me.

Update:  Check out these icons on this Flickr group