Skip to content

Instantly share code, notes, and snippets.

@wezm
Created March 26, 2009 03:44
Show Gist options
  • Save wezm/85859 to your computer and use it in GitHub Desktop.
Save wezm/85859 to your computer and use it in GitHub Desktop.
A pair of scripts to notify via Growl when a Skype user comes online
I turned off most of Skype's pesky notifications. This pair of scripts allows
you to be notified when a particular user becomes available. Since it is
separate from the Skype application its settings can be customised individually
in the Growl preference pane. I have mine set to play a sound and show the
notification as a bezel.
It probably isn't necessary for this to be two seperate scripts. At some point
I should look in to consolidating them into one AppleScript or one Ruby scirpt.
Probably the former.
-- This is an AppleScript (in case GitHub doesn't work it out)
on run argv
if length of argv < 1 then
-- Probably should return an error or something
return
end if
tell application "Skype"
return send command "GET USER " & item 1 of argv & " ONLINESTATUS" script name "get_skype_user_status.scpt"
end tell
end run
#!/usr/bin/ruby
if ARGV.size < 1
puts "Usage: skype_pounce <username>"
exit 2
end
user = ARGV[0]
user_status='UNKNOWN'
while user_status != 'ONLINE'
sleep 30
# XXX You will need to change this path if you are not wmoore
user_status = `osascript "/Users/wmoore/Source/skype-pounce/get_skype_user_status.scpt" "#{user}"`
user_status = user_status.split[-1]
end
time = Time.now.ctime
system('growlnotify', '-t', 'Skype Pounce', '-n', 'Skype Pounce', '-s', '-a', 'Skype', '-m', "#{user} is online\n#{time}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment