Shuffle thy mortal coil

Everything is done, for the Apple Digital Lifestyle project for our soon-to-retire management person. Getting to this point was a challenge only in terms of getting the data off of the old computer. The old machine was a Dell Dimension desktop loaded with Windows XP. I got the machine running and everything was fine, as far as Windows XP can be fine and I inserted my Knoppix DVD into the disk drive and rebooted. Then began the hurdles, the system was configured to boot first to the HD, not to the DVD, so I changed that and rebooted, the disk wouldn’t read and the system booted to the HD anyways, up comes Windows XP. Turns out, this computer is so old that it doesn’t have DVD, just a plain CD-ROM drive that I errantly mistook for a DVD drive. So I swapped out the Knoppix DVD and traded it for a Knoppix CD, rebooted and finally was up and running in Knoppix. I mounted the volume where the user files lived and used the tar utility to copy them over the network to my iMac on my desk. Once that was done I switched Knoppix out for DBAN, a popular hard drive erasing utility and booted into that, set it to chew away using DoD short wipe and proceeded to unpack the tar file I had copied over. I had unpacked the users data, trimmed out the meaningless Windows junk and ended up with about 800MB of user data in the end, mostly music and pictures and a few documents peppered in. I made a new ‘tar’ file and then copied that over to the new iMac using my handy-dandy USB file transmission cable. I had utterly blanked on the fact that both my iMac and the new iMac had fancy FireWire 800 capability, and only now that I reflect upon it do I feel rather silly in forgetting FireWire.

Once the data was over, I moved all the documents where they needed to be and then I thought about how I would manage the music and pictures. First was the pictures, I opened iPhoto ’09 (which came with the iMac!) and clicked on File, Import, pointed it to the directory that held the mishmash of user data and in about 45 seconds (I couldn’t help but time it) all the user pictures were now in iPhoto. I did the same thing with iTunes for the music and that took a whole 30 seconds. I then threw all the rescued remains in the trash (because they were now in iPhoto and iTunes) and then rescued bookmarks, that took a whole 10 seconds and into Safari it went. Cleaned everything up, installed the ‘Free’ HP All-in-one, and that took 2 minutes to unpack and 30 seconds to set up, I had a test print a minute later. Packed it all up, walked it to the manager’s office and he’s all set to enjoy.

What will he enjoy? His big thing is email and using iChat Video Chat. That’s the biggest selling point I think for this entire adventure. He can see his daughter and her budding family, full audio/video Mac goodness for as long as he likes to do so. I suggested that he could even set up a link in the morning and have a virtual “magic mirror” run all day long so they could spend time close to their loved ones without the expense or trouble of traveling.

After this entire adventure it struck me that I effectively ran an entire micro-sized Apple Store from inside my head. I had a Genius Bar (my office), I was the Genius (don’t have a fancy apple shirt, tho) and I got the user interested, sold, migrated, and trained – just like in an Apple Store. If Apple ever were to establish a store in Kalamazoo I would definitely moonlight there, without a doubt. The last time I did enter an Apple Store was with my Father in Syracuse a few months ago, the salespeople approached and I was busy pointing out a 21″ iMac to my Dad and as the sales guy approached he heard me actually running through his script. He chuckled and smiled and stood behind me. That’s why Apple succeeds, because they impress people like me and we become evangelists. Walking around, free Apple advertising and when someone comes up and asks, we show them all the wonderful fun they could have and then they go and buy into the dream as well, the cycle continues.

I say hello, I say goodbye…

For a few months I’ve used an app called Platypus on my Mac to create a pseudo-app that bundles a bash shell script which instructs my Mac to open various applications that I want to use during the day. What I want is very specific, I want to be able to login quickly to a idle Mac, but I want to have one icon to click on to start an entire host of applications, if I want to. The overall solution would of course be to mark every app as “Open on Login” but I don’t want them all to open each and every time I log-in, I’m picky. The bash script uses the open command to open applications. This command works well enough, but it leaves my screens littered with open application windows. This is not exactly what I want. I want all my applications to be opened, then I want them to be hidden. Cake and eat it too.

This morning, on a lark, I investigated alternatives to using Platypus. I know there is AppleScript, but I never really delved very deeply into the language. A little browsing and some tinkering and I have exactly what I want:

tell application “Mail” to activate
tell application “Firefox” to activate
tell application “iTunes” to activate
tell application “/Applications/Yahoo! Messenger.app” to activate
tell application “Stickies” to activate
tell application “Remote Desktop” to activate
tell application “Server Admin” to activate
tell application “Evernote” to activate
tell application “iCal” to activate
tell application “iChat” to activate
delay 0.5
tell application “Finder” to set visible of process “Mail” to false
tell application “Finder” to set visible of process “iTunes” to false
tell application “Finder” to set visible of process “Yahoo! Messenger” to false
tell application “Finder” to set visible of process “Stickies” to false
tell application “Finder” to set visible of process “Remote Desktop” to false
tell application “Finder” to set visible of process “Server Admin” to false
tell application “Finder” to set visible of process “Evernote” to false
tell application “Finder” to set visible of process “iCal” to false
tell application “iChat”
set minimized of window “bluedepth@gmail.com” to true
set minimized of window “andymchugh@atlas.dev.wmich.edu” to true
set minimized of window “AIM Buddy List” to true
set minimized of window “andy.mchugh@chat.facebook.com” to true
end tell

This script, shoved into an Application icon opens up every app I want in the morning, then hides them, except for iChat, it minimizes every window but my Bonjour list. I discovered that if I accidentally have a volume open when I run the script and there is an application in the volume and I ask that it be activated, the Mac is confused and asks me to pick the application from the list – so for Yahoo I had to explicitly state which one I wanted. Not a bug, just me being lazy.

The flipside of this also occurred to me. In the evenings I want to close all my applications. I could of course rely on the log-out procedure to do all the mopping up but there are some apps I use, like GroupWise and VirtualBox that can upset the log-out sequence. This script unmounts all volumes and then quits all open applications. That way I close all my apps before I log-out. Again, with the lazy:

tell application “Finder”
set bootDisk to name of startup disk
set otherDisks to every disk whose (name is not bootDisk)
repeat with myDisk in otherDisks
try
eject myDisk
end try
end repeat
end tell

tell application “System Events” to set the visible of every process to true
set white_list to {“Finder”}
try
tell application “Finder”
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to item i of the process_list
if this_process is not in white_list then
tell application this_process
quit
end tell
end if
end repeat
on error
tell the current application to display dialog “An error has occurred!” & return & “This script will now quit” buttons {“Quit”} default button 1 with icon 0
end try

Yay for Lazy! 🙂