-- Save your current applicationtell application "System Events" set currentApp to name of 1st process whose frontmost is trueend tell -- Bring Lync to the front so we can use the menutell application "Microsoft Lync" activateend tell -- Set your status to 'Available'tell application "System Events" tell process "Microsoft Lync" tell menu bar 1 tell menu bar item "Status" tell menu "Status" click menu item "Available" end tell end tell end tell end tellend tell -- Return to your previous applicationtell application currentApp activateend tell
Comments