Hack 16. Run Phlink Even When Logged Off
Phlink is a great application, but it's a desktop program, not a server app that's made to run in the background. So, when you log off, it shuts down and can't answer callsunless you customize it to do so. To get Phlink to launch upon login is really easyjust make it a login item for your user account in OS X Preferences. But getting Phlink to stay running even after you've logged out is a challenge. Of course, Phlink is most useful when it's running at all times, so you need to be able to do this. Thankfully, for every unique need there's an equally unique hack. In this case, we're going to launch Phlink under a different user account. This user account will be automatically logged in at boot time, allowing the Phlink application to launch in that user account. Then, we'll create an Apple-Script login item to switch to the user-selection screen automatically, giving you the option of logging in as any user you want. To get started, open up System Preferences and click the Accounts preference pane. Click the + icon to create a new account, and call it Phlink. Make sure it is set to log in automatically upon startup. Now, log in as this user. Be sure to enable Phlink as one of its login items. To enable login items for the Phlink user, return to System Preferences and select the Login Items tab. Now you can add Phlink to and remove it from this list, causing it to launch whenever the user phlink logs in. Now, launch the AppleScript editor, and create a script with this single line: do shell script "/System/Library/CoreServices/Menu \\ Extras/User.menu/ Contents/Resources/CGSession suspend" The purpose of this one-line AppleScript is to present the user-switching dialog on the screen. We'll use this AppleScript to get back to the traditional login screen once the Phlink user has logged in and the Phlink app has launched. Save this AppleScript and then make it a login item for the user phlink. (Be sure it's listed after the Phlink login item.) Then, save and exit Preferences. Now you're ready to try it. Reboot your Mac. If all goes well, your Mac will log in as the Phlink user automatically, launch Phlink, and return you to the screen where you can choose which user to log in as (or the username and password prompt, if that's how your Mac is configured). Now, Phlink will handle your calls even while you're logged in as another user, or logged off altogether, because it's running as its own user in the background. |