HP multifunction devices are accompanied by boneheaded OS X drivers. In particular, stuff fails unless the current user has a working verion of the background app "HP Communications." A previous hint explained how to deal with the fact that this app does not necessarily play nicely with sleep mode. In this hint, I explain how to make the app work with Fast User Switching.
Begin by installing WinSwitch (the Win comes not from Microsoft but from the first name -- Wincent -- of the developer). This is a freeware (but do consider donating!) MenuExtra that replaces Apple's own Fast User Switching menu. The nice thing about WinSwitch is (besides being, IMO, well-written) that it listens for notifications of NSWorkspaceSessionDidResignActiveNotification and NSWorkspaceSessionDidBecomeActiveNotification. WinSwitch will automatically run items found in ~/Library -> Application Support -> WinSwitch -> Switch-In Items and ~/Library -> Application Support -> WinSwitch -> Switch-Out Items by using the equivalent of double-clicking them in the Finder ([[NSWorkspace sharedWorkspace] openFile:itemPath], if you care to know). We use this to automatically quit HP Communications for the user switching out, and start it for the user switching in.
First, create ~/Library -> Application Support -> WinSwitch -> Switch-In Items -> StartHP.command, containing the following script:
#!/bin/sh
#ac
# wakeup: start HP Commmunications process
#
open /Library/Printers/hp/HP Communications.app
and then do a chmod 755 Library/Application Support/WinSwitch/Switch-In Items/StartHP.command to make it executable. Now create ~/Library -> Application Support -> WinSwitch -> Switch-Out Items -> Kill_HPCommunications.command, containing:
#!/bin/sh
#
# kill HP Communications process
#
kill -HUP `ps axwww | egrep -i
"/Library/Printers/hp/HP Communications.app" | egrep -iv
"egrep -i" | awk '{print $1}'`
killall pipedaemon
and again change the permissions by typing chmod 755 ~/Library/Application Support/WinSwitch/Switch-Out Items/Kill_HPCommunications.command
[/code]
Now log in or switch to all the other users, and create the same scripts. If you want to keep the scripts in a central location and symlink to them, that should work, but you must ensure that the metadata causes the commands to run (rather than, say, open in an editor) when you double-click them. While you are switched in as the other users, take a minute to run /Users -> Shared -> Activate WinSwitch.command, to get WinSwitch working for them as well.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20041013213911785