Last active
December 15, 2015 07:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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