Created
October 24, 2012 19:22
-
-
Save dakrone/3948237 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- Skype Mute, Version 1.1 | |
| -- Copyright (c) 2008 Chuck Burt. All rights reserved. | |
| -- http://www.chuckburt.com/ | |
| -- | |
| -- This program is free software; you can redistribute it and/or modify | |
| -- it under the terms of the GNU General Public License as published by | |
| -- the Free Software Foundation; either version 2 of the License, or | |
| -- (at your option) any later version. | |
| -- | |
| -- This program is distributed in the hope that it will be useful, | |
| -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| -- GNU General Public License for more details. | |
| -- | |
| -- Bug fixes, suggestions and comments should be submitted to: | |
| -- http://www.chuckburt.com/ | |
| tell application "Skype" | |
| -- Get current mute status | |
| set muteStatusOriginal to (send command "GET MUTE" script name "Skype Mute") | |
| end tell | |
| -- If mute is off, turn it on | |
| if the muteStatusOriginal is "MUTE OFF" then | |
| tell application "Skype" | |
| send command "SET MUTE ON" script name "Skype Mute" | |
| set muteStatusNew to (send command "GET MUTE" script name "Skype Mute") | |
| end tell | |
| -- Notify Growl of the new status | |
| if the muteStatusNew is not equal to the muteStatusOriginal then | |
| growlNotify("Skype Mute", muteStatusNew) | |
| else | |
| growlNotify("Skype Mute", "Mute/Unmute Failed") | |
| end if | |
| end if | |
| -- If mute is on, turn it off | |
| if the muteStatusOriginal is "MUTE ON" then | |
| tell application "Skype" | |
| send command "SET MUTE OFF" script name "Skype Mute" | |
| set muteStatusNew to (send command "GET MUTE" script name "Skype Mute") | |
| end tell | |
| -- Notify Growl of the new status | |
| if the muteStatusNew is not equal to the muteStatusOriginal then | |
| growlNotify("Skype Mute", muteStatusNew) | |
| else | |
| growlNotify("Skype Mute", "Mute/Unmute Failed") | |
| end if | |
| end if | |
| using terms from application "GrowlHelperApp" | |
| -- Register Growl | |
| tell application "GrowlHelperApp" | |
| register as application "Skype Mute" all notifications {"Alert"} default notifications {"Alert"} icon of application "Skype.app" | |
| end tell | |
| on growlNotify(growlTitle, growlDescription) | |
| tell application "GrowlHelperApp" | |
| notify with name "Alert" title growlTitle description growlDescription application name "Skype Mute" | |
| end tell | |
| end growlNotify | |
| end using terms from |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment