Skip to content

Instantly share code, notes, and snippets.

@jarobins
Last active December 15, 2015 07:29
Show Gist options
  • Save jarobins/5223632 to your computer and use it in GitHub Desktop.
Save jarobins/5223632 to your computer and use it in GitHub Desktop.
Sends an alert to the user when I person logs on to Lync.
# Person Alert
# Jake Robinson
# 06MAR2013
import win32com.client
import time, win32api
im = win32com.client.Dispatch('Communicator.UIAutomation')
user_name = raw_input('Email of person to track: ')
print 'I will let you know when they log on.'
condition = True
while condition:
time.sleep(1)
person = im.GetContact(user_name, im.MyServiceId)
if person.Status == 2:
option = win32api.MessageBox(0, '%s has logged on!' % user_name, 'ALERT', 0x00001000)
if option == 1:
condition = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment