> On 10/20/00 10:22 AM, "Neil" <[EMAIL PROTECTED]> wrote:
>
>>> Can't get text 2 thru -1 of H
>>
>> Does that mean anything to anybody here? Thanks in advance,
>
>
> It usually means that you have a blank, or just one letter, where David
> expected you to always have 2 or more characters. I don't have the script
> around - if someone wants to send it again, I'll take a look at it if David
> hasn't found the glitch yet
Paul, here’s the script.
-- Dial Phone
-- © David Cortright, 2000
-- <[EMAIL PROTECTED]>
-- This script uses the application Acid Jazz to dial phone numbers for a selected contact in Entourage.
-- Select any one contact in a list view, then invoke this script.
-- If the selected contact has more than one number, you'll be asked to choose which one to dial.
-- Get Acid Jazz from here: <http://hotfiles.zdnet.com/cgi-bin/texis/swlib/mac/infomac.html?fcode=MC10904>
-- Acid Jazz is shareware ($15).
-- Minor modifications by Matt Ridley <[EMAIL PROTECTED]>.
set phoneList to {}
set errString to "This script only works with one contact selected in a list view."
tell application "Microsoft Entourage"
try
set s to the selection
set t to item 1 of s
if the class of t is contact then set theContact to t
on error theErr
display dialog theErr & return & return & errString with icon 1 buttons {"OK"} default button "OK"
return
end try
try
set homeNumber to home phone number of theContact
set workNumber to business phone number of theContact
set otherHomeNumber to other home phone number of theContact
set otherWorkNumber to other business phone number of theContact
set mobileNumber to mobile phone number of theContact
set mainNumber to main phone number of theContact
set assistantNumber to assistant phone number of theContact
set pagerNumber to pager phone number of theContact
set homeFaxNumber to home fax phone number of theContact
set workFaxNumber to business fax phone number of theContact
set custom1 to custom phone number one of theContact
set custom2 to custom phone number two of theContact
set custom3 to custom phone number three of theContact
set custom4 to custom phone number four of theContact
if homeNumber is not "" then set phoneList to phoneList & ("Home: " & homeNumber)
if workNumber is not "" then set phoneList to phoneList & ("Work: " & workNumber)
if otherHomeNumber is not "" then set phoneList to phoneList & ("Home 2: " & otherHomeNumber)
if otherWorkNumber is not "" then set phoneList to phoneList & ("Work 2: " & otherWorkNumber)
if mobileNumber is not "" then set phoneList to phoneList & ("Mobile: " & mobileNumber)
if mainNumber is not "" then set phoneList to phoneList & ("Main: " & mainNumber)
if assistantNumber is not "" then set phoneList to phoneList & ("Assistant: " & assistantNumber)
if pagerNumber is not "" then set phoneList to phoneList & ("Pager: " & pagerNumber)
if homeFaxNumber is not "" then set phoneList to phoneList & ("Home Fax: " & homeFaxNumber)
if workFaxNumber is not "" then set phoneList to phoneList & ("Work Fax: " & workFaxNumber)
if custom1 is not "" then set phoneList to phoneList & ("Custom 1: " & custom1)
if custom2 is not "" then set phoneList to phoneList & ("Custom 2: " & custom2)
if custom3 is not "" then set phoneList to phoneList & ("Custom 3: " & custom3)
if custom4 is not "" then set phoneList to phoneList & ("Custom 4: " & workFaxNumber)
set theName to name of theContact
if theName = "" then set theName to company of theContact
on error theErr
display dialog theErr & return & return & errString with icon 1 buttons {"OK"} default button "OK"
return
end try
end tell
if (count of phoneList) = 1 then
set theResult to item 1 of phoneList
else
if (count of phoneList) is greater than 1 thentry
set theResult to choose from list phoneList with prompt "Choose a phone number to dial for " & theName & ¬
":" default items {(item 1 of phoneList)} without multiple selections allowed and empty selection allowed
on error
display dialog "This script requires a scripting addition that is not installed on your computer. " & ¬
"You must have OS 8.5 or greater in order to use this script." with icon 1 buttons {"OK"} default button "OK"
end try
else
display dialog "That contact has no phone numbers." with icon note buttons {"OK"} default button "OK"
return
end if
end if
if theResult = {} or theResult is false then return
set t to item 1 of theResult
set i to offset of ": " in t
set theNumber to text (i + 2) thru -1 of t
tell application "Acid Jazz" to Dial Phone theNumber
