Navigation
Subscribe
Twitter
Main | Preparing for Lion »
Friday
Nov252011

Slow Startup in Mac OS X

So for some time now whenever I start up my MacBook Pro everything took a long time to be ready to do what I told it. It would just sit there thinking for quite a while before it would accept any input or respond.

I only had one application start at login and that was Skype. The reason for this is because it is not an app I use, but one I want to have open in case someone wants to call me.

Anyway, I tried an experiment where I turned off Skype launching at start up and difference was amazing. I don't know if they have bad memory code on start up or what.

I still wanted to Skype to start up automatically, but wanted a faster start up time. The answer, as usual for me, was AppleScript, and it is a super simple one:

tell application "Skype"

delay 30

activate

end tell

Basically it just sits there for thirty seconds and then starts Skype. So copy and paste this into AppleScript Editor and save it somewhere out of the way. I put mine at /Applications/Scripts/LaunchSkype.scpt.

The next step is to automatically trigger the script. I use Lingon to create launchd scripts but you can also write them manually.

For example, create a file called say, com.liamhughes.LaunchSkype.plist, in ~/Library/LaunchAgents/ with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.liamhughes.LaunchSkype</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/Applications/Scripts/LaunchSkype.scpt</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

This will cause your script to be run whenever you login to your computer.

Best of both worlds: fast start up time and automatic launch of Skype (or whatever application you want).

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>