Installing a HP LaserJet 1505 printer on Apple OSX Mountain Lion

What a problem this was! We had a user with a MacBook Pro that had a new copy of Macintosh OSX Mountain Lion 10.8.2 running on it. Plugged in a rinky-dink HP LaserJet 1505 and nothing. Even though there was the exact same printer installed before, from the user’s home, the system refused to reuse the connection for the printer at work. Obviously that has to be because the system notices it’s a different device and refuses to play along, which I find stupid.

Plug in the printer, try to add it, and the Add Printer function goes out to Apple Software Update to look for the driver and then comes back and tells us that nothing is available. Then commence zombie debugging via muzzle flare, wandering around in the dark trying to fix what shouldn’t be happening but apparently is beyond all logic and reason.

So how you do diagnose a Mac? Here’s a handy-dandy guide which anyone can use to fix their Macs. I seriously doubt any issues ever survive this particular procedure:

  1. Clear PRAM – Turn off computer, turn on computer while holding down  Command-Option-P-R. The computer will restart and you’ll hear the startup chime twice. Let go of the keys. ~ For this, just do it. It doesn’t matter if you don’t think doing this will fix your problem, it will. Just shut your pie hole and do this. If you don’t do it, I don’t want to hear about your problems. It’s magical. I don’t care if Apple says it won’t do anything. This thing DOES EVERYTHING IN CREATION – apparently. That and it cannot hurt. Lots of fluids and plenty of bed-rest. 
  2. Repair Disk Permissions – Start Disk Utility, find your “Macintosh HD” and click “Repair Disk Permissions” and wait. Do this. Often. Regularly. Lots. Weekly. Now.
  3. Download Onyx. Pick which version of OSX you are using, download it, install it and use it. I recommend skipping everything it wants to do and going right for the Automation button. Uncheck “Repair Permissions” and “Display of folders content” and check the rest. Click Execute and wait. When the system asks for a reboot. Reboot. Everyone should do this weekly. Think of it like vitamins for your Mac. Plus, it can’t hurt.

At this point your system should be all spic and span and whatever niggling bit was bothering you should be dealt with. Of course, for the problem I had to deal with at work, there is one little thing extra, one thing more. Open Finder, click Go on the Menubar, then Go to Folder… and type in /Library/Printers and click Ok. You’ll see a list of folders. In this list find the folder named “hp” and KILL IT WITH EXTREME PREJUDICE. Y’arr! This !@#$ folder is at the very center of my hatred for all that is Hewlett-Packard. I’ve started to unceremoniously refer to them as Fudge Packard. Bastards. Anyways, killing the folder does the trick, it clears everything up and Mountain Lion can download software from Apple again for the HP Drivers – blah blah blah. I’d rather just get a sledgehammer and pound the HP LaserJet 1505 into foil, but hey, you have to cope or have some sort of attack. I regret buying HP. I regret the LaserJet 1505. What a piece of crap. Steaming.

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! 🙂