Quantcast

Un-fuX0ring Skype on Mac OSX

Skype is poorly-designed software, but I use it to chat with people who refuse to use anything else. I’ve already written how Skype is the worst software installed on my Mac, but now I have two new frustrations:

1. Skype doesn’t gracefully deal with my laptop going to and waking up from sleep. When my laptop wakes up from sleep, Skype should change my status back to online, but it doesn’t.

2. The control to change the Skype status message, which they called the mood message, is so hidden away that it’s difficult to change, and since you don’t see your own status in your buddy list, it is frequently out of date.

These are two things that iChat has no problem with. We could easily sync our iChat status with Skype if both applications supported AppleScript. We know that iChat supports AppleScript, but does Skype?

It turns out that Skype’s AppleScript support is limited to just one command that you can use to call Skype’s public API. That’s good enough for us, and an interesting solution to dealing with how frustrating it is for app developers to support AppleScript.

Here is a script that syncs iChat’s online status and status message with Skype. You can run it periodically via launchd, as described here.

#!/usr/bin/perl
 
use strict;
use warnings;
 
my $iChatStatus = `osascript -e 'tell application "iChat" to status'`;
chomp $iChatStatus;
 
my $skypeStatus = '';
 
if ('available' eq $iChatStatus) {
	$skypeStatus = 'ONLINE';
} elsif ('away' eq $iChatStatus) {
	$skypeStatus = 'AWAY';
} elsif ('offline' eq $iChatStatus) {
	$skypeStatus = 'OFFLINE';
}
 
if ('' ne $skypeStatus) {
	`osascript -e 'tell application "Skype" to send command "SET USERSTATUS $skypeStatus" script name "s1"'`;
}
 
my $statusMsg = `osascript -e 'tell application "iChat" to status message'`;
chomp $statusMsg;
 
`osascript -e 'tell application "Skype" to send command "SET PROFILE MOOD_TEXT $statusMsg" script name "s2"'`;

No comments yet. Be the first.

Leave a reply