I really like the music I can stream & download from Wolfgang’s Vault. It’s all live concert tracks from hundreds of great bands & artists, in a wide variety of genres: Rock, Blues, Country, Jazz, & Folk. For $3 a month (that’s nothin’!) I can stream as much music as I want, download concerts for $5 a pop, & in addition, I get to download two shows a week for free. All in all, quite a deal.

The only problem is that the default download app is a Java-based hunk o’ crap. It literally would never work for me, & would instead spin & spin. Finally I filed a bug with tech support, & I was told to try the legacy Mac download app, which does work. It only has two problems:

  1. I have to sign in. Every. Single. Time. Not a huge biggie. I use the mighty TextExpander to quickly fill in my email & my password, so that’s only mildly annoying.
  2. The app pukes two files into my home directory: cvdm.dat & cvdm.err. While the app is running, it also adds cvdm.pid, but at least that file is deleted when you quit the app. The other two stay behind, cluttering up my otherwise neat & organized home directory. And if you delete those two files, your Preferences are deleted as well. Lovely.

I finally got sick of those files staring at me every time I’m using Path Finder or, far more rarely, Finder. So I decided to write a shell script that would fix the problem. To invoke it, I use Alfred 2, but really, you don’t need it, as the shell script works just fine by itself. But if you use Alfred (or LaunchBar, or the fantastically wonderful Keyboard Maestro), you can call the shell script using it for that extra bit of laziness.

Optional: Install terminal-notifier gem

In the script you’ll notice that I use terminal-notifier, a Ruby gem that works with the Mac OS Notification Center. If you want to use it, you’ll need to install the gem first:

$ sudo gem install terminal-notifier

By the way, using it couldn’t be easier:

$ terminal-notifier -message "Message Text" -title "Message Title"

If you don’t want to use terminal-notifier, just remove those lines from the script (& the comments above them, of course).

The shell script: wolfgang.sh

In your ~/bin directory (yes, you’d better have one), add the following script:

#!/bin/bash

#===============================================================================
#          FILE:  wolfgang.sh
#         USAGE:  Run manually or invoked from Alfred 2
#   DESCRIPTION:  Manages Wolfgang’s Concert Vault Download Manager app
#                 & hides stupid files that are placed in ~/ & needed by CVDM
#        AUTHOR:  Scott Granneman (RSG), scott@chainsawonatireswing.com
#       VERSION:  0.1
#       CREATED:  04/27/2013 11:24:07 CDT
#      REVISION:  
#===============================================================================

case $1 in
  open)
    # Unhide files required by Concert Vault Download Manager
    mv /Users/USERNAME/.cvdm.dat /Users/USERNAME/cvdm.dat
    mv /Users/USERNAME/.cvdm.err /Users/USERNAME/cvdm.err
    # Open Concert Vault Download Manager
    open /Applications/Concert\ Vault\ Download\ Manager.app
    # Notification
    terminal-notifier -message "" -title "Wolfgang’s Vault is Open!"
    ;;
  quit)
    # Quit Concert Vault Download Manager
    kill $(ps aux | grep "[C]oncert Vault Download Manager" | awk '{print $2}')
    # Hide files required by Concert Vault Download Manager
    mv /Users/USERNAME/cvdm.dat /Users/USERNAME/.cvdm.dat
    mv /Users/USERNAME/cvdm.err /Users/USERNAME/.cvdm.err
    # Notification
    terminal-notifier -message "" -title "Wolfgang’s Vault is Closed!"
    ;;
  *)
    # Typo? 
    terminal-notifier -message "You must type either 'open' or 'quit'" -title "Need Correct Argument"
    ;;
esac

Replace the eight instances of USERNAME with your Mac OS username, save it, & make it executable (chmod 755 ~/bin/wolfgang.sh).

Side note: Some of my eagle-eyed readers may have noticed this line, which gives me the PID for the Download Manager app & then kills it:

> kill $(ps aux | grep "[C]oncert Vault Download Manager" | awk '{print $2}')
> 

“Hey,” they’re thinking, “why didn’t you just use cat cvdm.pid to get the PID? After all, the app generates that file only when it’s running, so surely it contains the PID, right?”

To which I reply, “Oh my gosh, you & I had the exact same thought! But guess what? It turns out that cvdm.pid is 0 bytes & doesn’t contain squat. How convenient! Hence my fallback on an old standby.”

At this point, you can stop & just use the script. To open the Concert Vault Download Manager (CVDM) & unhide those files it uses:

$ ~/bin/wolfgang.sh open

To close the CVDM & hide the files:

$ ~/bin/wolfgang.sh quit

That’s all well & good, but it’s too much typing. Let’s set up Alfred to make this quicker & easier.

The Alfred workflow

I upgraded to Alfred 2 the day it came out, & couldn’t be happier. It’s an excellent upgrade to an already fantastic product. It’s very different that the original Alfred, however, so if you’re still using that, you’re going to have to figure out how to set things up yourself (that said, it’s fairly close to what I’m doing here, so it’s not hard).

Open Alfred’s Preferences & go to Workflows. Create a new Workflow by going to + > Templates > Essentials > Keyword To Script.

In the list of Workflows you’ll see a new one: Keyword to Script, by Unknown. Double-click it to open its Details. Enter the following:

  • Workflow Name: Manage Wolfgang’s Vault Downloader
  • Description: Open or Quit Wolfgang’s Vault Download App
  • Bundle ID: com.granneman.wolfgang
  • Created By: Scott Granneman
  • Website: http://ChainsawOnATireSwing.com

For the icon, I searched Google Images for “Wolfgang’s Vault logo” & used one of the ones I found.

Press Save. It should now be named Manage Wolfgang’s Vault Downloader, by Scott Granneman.

Double-click on the Keyword input so it opens. Enter the following:

  • Keyword: wolf
  • Check the box in front of With Space
  • Select Argument Required from the dropbown menu
  • Title: Manage Wolfgang’s Vault Downloader
  • Subtext: Enter "open" or "quit"

Press Save.

Double-click on the Run Script action1 so it opens. Enter the following:

  • Language: /bin/bash
  • Escaping: Uncheck all
  • Script: /Users/USERNAME/bin/Music/wolfgang.sh {query}

Replace USERNAME with your Mac OS username & press Save.

Hover over the Keyword input until the little nub appears on its right side. Click on it & drag the resulting line to the little nub that appears on the left side of the Run Script action until they’re connected. It should look like this:

If you don’t want to do all of the steps above, you can just download the workflow & double-click to install it. Be sure to double-click on the Run Script action & change USERNAME, though!

You’re finished! Time to test our new Workflow.

To open the Concert Vault Download Manager (CVDM) & unhide those files it uses, open Alfred (I use Command+Space2) & type the following:

wolf open

To close the CVDM & hide the files:

wolf quit

And there you go. I hope this shows a way to get around a particular annoyance that really shouldn’t exist at all. A little shell scripting, a little Alfred, & voilà! you can hide some sloppy work by others.

  1. Some of you Alfred 2 users may be wondering why I didn’t use the Terminal Command action instead. The reason: I didn’t want a new tab to open in iTerm 2, my terminal app of choice, every time I used this Workflow. 

  2. Yes, I know that’s the default for Spotlight. Once I started using Alfred years ago, I quickly realized that I would hardly ever need to use Spotlight directly again, so I re-mapped Command+Space to open Alfred. To open Spotlight, I use Alt+Space.