MacBook Pro temparature as Skype mood message
Today we were talking at local.ch (almost a Mac shop now) about the MacBook Pro CPU temperature (too high). So now some of us are putting the temperature into the Skype mood message.
First you need to download SpeedIt. Make sure you get the version for the correct operating system release.
Then instead of the script in the original article, use this:
#!/usr/bin/env ruby
temp=`/usr/sbin/sysctl kern.cpu_temp`.split(’:’)[1].strip
msg=“MacBook Pro temperature: “ + temp + “ÂșC”cmdline = “osascript “ + “-e 'tell application \“Skype\”’ “ + “-e 'send command \“SET PROFILE MOOD_TEXT #{msg}\” script name \“Temperature\”’ “ + “-e 'end tell’”
`#{cmdline}`
There is a special symbol for degrees which will only get passed correctly to Skype if you save that script in the MacRoman encoding.
Skype mood message countdown on the Mac
The following 8-line Ruby script takes the problem away from me.
#!/usr/bin/env ruby
deadline = Time.local(2007, 01, 20, 22, 05)
seconds = deadline - Time.new
days = (seconds / 60 / 60 / 24 * 1000).round / 1000.0
cmdline = "osascript " +
"-e 'tell application \"Skype\"' " +
"-e 'send command \"SET PROFILE MOOD_TEXT " + days.to_s + " days left\" script name \"Countdown\"' " +
"-e 'end tell'"
`#{cmdline}`
Save that and put the following into your crontab (accessible with crontab -e on the command line):
*/2 * * * * /Users/pneff/bin/skype-countdown.rb
Of course you can change both the time difference and the rounding.
The event I’m counting down to occurs on January 20 at 22:05.
The only thing that needs explanation is the invocation of the osascript command. That’s a command line tool that OS X provides to execute Apple Script. The whole thing could also be programmed in AppleScript, but Ruby is my script language of choice – and this way I was able to do that in five minutes – less time than it took to document that here.
To get started with the Skype API for AppleScript, see Skype AppleScript API (just a short intro) and the Skype API reference.
Call center with Skype
Apparently different people can log in to the same Skype account and then take calls from there. The only question that remains: can I log in to two accounts at the same time? Because I'd definitely want to be logged in to my personal Skype account at the same time as well.