Created
March 9, 2012 01:37
-
-
Save prenagha/2004543 to your computer and use it in GitHub Desktop.
LaunchBar dial phone via GrowlVoice
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
-- | |
-- Use GrowlVoice (version 2.0 or later) to dial a phone number from LaunchBar | |
-- http://www.growlvoice.com/ | |
-- | |
-- To Use: | |
-- Put this script in ~/Library/Application Support/LaunchBar/Actions | |
-- In LaunchBar preferences, Actions screen, Default Actions tab, | |
-- set the Phone Numbers field to this script | |
-- This script will appear by default as the action for a phone number, invoke it | |
-- to start a call to that number in GrowlVoice | |
-- | |
on handle_string(s) | |
set theNumber to CleanTheNumber(s) | |
open location "growlvoice:" & theNumber & "?call" | |
end handle_string | |
-- Remove non-numerical characters from the phone number | |
on CleanTheNumber(numToDial) | |
set theDigits to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} | |
set cleanedNumber to "" | |
repeat with i from 1 to length of numToDial | |
set j to (character i of numToDial) | |
if j is in theDigits then set cleanedNumber to cleanedNumber & j | |
end repeat | |
return cleanedNumber | |
end CleanTheNumber |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment