Jan 25, '07 07:30:00AM • Contributed by: Anonymous
I solved this problem with two Automator scripts, VLC, and a Preference Pane called Do Somthing When. The first step is to get our tools: First, install Do Something When... according to the instructions that come on the disk image. Second, put VLC somewhere in your Applications folder -- or, really, wherever. We'll come back to these in a second.
Now for the Automator magic. Open up Automator and create this sequence of actions:
- iTunes -> Get Tracks of Selection or Selected Playlist
- Finder -> Copy Finder items
- To: [A folder of your choice. (/path/to/folder)]
- Check replace existing files.
- Finder -> Open Finder items:
- Open with: VLC
- Automator -> Run Applescript:
tell application "iTunes" quit end tell
- Automator -> Run AppleScript:
tell application "VLC" quit end tell tell application "iTunes" run end tell
- Automator -> Run Shell Script:
cd path/to/folder rm -r *
- In the Rule Name field, type in Docked Songs
- When [the external hard drive mounts] . . .
- Open [The application you made in Automator in script number two above]
So, what exactly is this thing going to do? Well, I'll demonstrate. Once you've placed the actions in their appropriate locations, when iTunes is up, you'll now have a new item in your system script menu. I called mine Undocked. Running it does the following:
It takes either the selected playlist's contents, or the individual files you've selected, and copies them to a folder in the Finder. It then quits iTunes and opens those items up in VLC. Boom. You've now got a temporary playlist. Now, in VLC, you'll have a menu called Docked or whatever you called the actions from the second Workflow. Running this quits VLC, opens iTunes, and deletes the files you temporarily used.
Using Do Something When... automatically sets it up so that whenever the external drive is mounted, it will run through the application version of the Automator script #2 (killing VLC, launching iTunes, deleting temporary songs), which is a nicety.
As for the smart playlist, I set it up so that it lasts approximately the duration of my battery -- why have it any longer if you'll be plugging in the machine (and probably docking it) at some point?
And that's it. It may seem a bit convoluted, at first, but it has been working really well for me. The advantage of this over doing these steps manually in the Finder is the fact that you don't have to hunt for each file individually, drag them over to a folder and then open VLC and drag the files into it. It's really quite handy if you're in a similar situation to mine.
[robg adds: I haven't tested this one, but note that the script contains an rm -r *. If you're going to test this one, please make sure you've got the paths correct, and that you have a recent backup of your files, just in case something goes wrong.]
