Title: OneClick script for Automatic phone dialing
On or near 11/14/00 7:30 AM, Neil at [EMAIL PROTECTED] observed:
> on 11/13/00 2:50 PM, Allen Watson at [EMAIL PROTECTED] wrote:
>
>> I've discovered that the program OneClick, a highly versatile
>> macro/scripting application, has a "dial" command. I am planning to use that
>> to dial my telephone numbers in Entourage.
>
> I have OneClick also, so please keep us posted on your work. By the way, I
> keep my speed dial numbers on my OneClick System Bar. It's very handy.
>
On or near 11/14/00 7:30 AM, Neil at [EMAIL PROTECTED] observed:
> on 11/13/00 2:50 PM, Allen Watson at [EMAIL PROTECTED] wrote:
>
>> I've discovered that the program OneClick, a highly versatile
>> macro/scripting application, has a "dial" command. I am planning to use that
>> to dial my telephone numbers in Entourage.
>
> I have OneClick also, so please keep us posted on your work. By the way, I
> keep my speed dial numbers on my OneClick System Bar. It's very handy.
Here is what I have so far. Put this script on a button with a local Entourage OneClick palette, or possibly a global palette. It will copy any telephone number you have selected in text (hyphens and parentheses okay, commas will cause a pause), and dial it. It validates things to some extent, and will reject non-numeric characters or numbers with less than 7 digits. It will strip the local area code and insert a “1” for long distance calls or, if you are in an area like Portland with two area codes that must be dialed without the leading “1”, you can set the variables at the top appropriately so that will happen. See variables local1, local2, and omitLD1. All this happens ONLY if you select ten digits; if you have eleven or more (i.e., you include the “1” or you are doing an international call) there is no further validation.
Variable theNum, temp, local1, local2, omitLD1, i, validchars, loc, aChar, AC
// If your area has two area codes that must be dialed without a leading "1" for local calls, put those
// area codes in variables local1 and local2. Otherwise, set both variables to "9999".
local1 = "503" // Portland, OR area codes
local2 = "971"
// If you want the script to strip your local area code before dialing local calls, put your local area code into
// variable omitLD1; otherwise, set omitLD1 to 0
omitLD1 = 0
Menu.Update
If Menu("Edit", "Copy").Enabled
SelectMenu "Edit", "Copy"
// Check that it is all digits; remove hyphens, parentheses and spaces
theNum = Clipboard
theNum = Replace "-", theNum, "", 1
theNum = Replace "(", theNum, "", 1
theNum = Replace ")", theNum, "", 1
theNum = Replace " ", theNum, "", 1
theNum = Replace Return, theNum, "", 1
validchars = "0123456789," // Allow only digits and comma
For i = 1 To Length theNum
aChar = SubString theNum, i, i
loc = Find aChar, validchars
If loc = 0
Message "Invalid character found:" & SubString theNum, i, i
Exit
End If
End For
If theNum = ""
Message "No number found to dial."
Exit
End If
// use temp just for counting digits, without commas
temp = Replace ",", theNum, "", 1
If (Length temp) < 7
Message "7 or more digits are required, you selected: " & theNum
Exit
End If
If (Length temp) = 10 // Long distance
AC = SubString temp, 1, 3
If ((AC = local1) OR (AC = local2)) // Local area codes
// Don't add a "1" prefix
Else If (AC = omitLD1)
theNum = Replace AC, theNum, "" // Delete area code only
Else
theNum = "1," & theNum
End If
End If
Message "About to dial " & theNum & "..." & Return & "Pick up phone when dialing starts."
Dial theNum
Pause 150
Else
Message "Nothing selected."
End If
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984
My web page: <http://home.earthlink.net/~allenwatson/>
--
Peace,
Allen Watson <[EMAIL PROTECTED]> XNS name: =Allen Watson
A Mac family since 1984
My web page: <http://home.earthlink.net/~allenwatson/>
- Automatic phone dialing Allen Watson
- Re: Automatic phone dialing JCarlos Trajano
- Re: Automatic phone dialing Allen Watson
- Re: Automatic phone dialing Neil
- Re: OneClick script for Automatic phone d... Allen Watson
- Re: OneClick script for Automatic ph... Paul Berkowitz
- Re: Automatic phone dialing JCarlos Trajano
