Created
March 9, 2012 01:38
-
-
Save prenagha/2004547 to your computer and use it in GitHub Desktop.
LaunchBar text 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 | |
-- This script will appear as an action for a phone number, invoke it | |
-- to start a text to that number in GrowlVoice | |
-- | |
on handle_string(s) | |
set theNumber to CleanTheNumber(s) | |
open location "growlvoice:" & theNumber & "?text" | |
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