3.6 Configuring AppleScript Phone Plugin


TIPP: Don't miss our experimental tutorial on how to monitor your iPhone (or many more mobile phones) with BluePhoneElite 2 and the FoneConnector AppleScript Phone Plugin!



Requirements:
  • Apple OS X 10.5
     
  • Some other application that can send a telephone number to FoneConnector via AppleScript

Please note:
We can't offer free individual support for any AppleScript scripting. If you are not familiar with AppleScript and you want to connect your telephony system or phone workflow with Daylite we offer you development services on a contract basis. Please e-mail us with more details for a quote.


For currently supported FoneConnector features please check the appropriate tab:



3.6.1. Add the AppleScript Phone Plugin in FoneConnector -> Preferences -> Phones

            


3.6.2. Create a folder (name it as you like) somewhere on your Mac.

Click and drag the Script-icon into this folder.

This saves an AppleScript called »AppleScriptSample.scpt« into this folder.

There is no further configuration necessary as the AppleScript Phone Plugin simply waits to be triggered with a caller's phone number from a 3rd party application.

            


3.6.3. Testing the sample AppleScript

Double-click on »AppleScriptSample.scpt« ...



... to open it in Apple's Script Editor. Don't edit anything - just click on the »Run« button ...



... this opens a dialog where you can enter a caller's phone number for simulation and testing purposes.



When clicking »Simulate Call« the Call Window should open in Dayite:




3.6.4. AppleScript sample code

Below is the sample code used. Please take it as a starting point and adapt it to your needs to integrate with your workflow.

#ask for a Phone Number
display dialog "Enter a Phone number" default answer ¬
"" buttons ¬
{" Simulate Call "} default button 1
set incomingNumber to text returned of result

# Check if Daylite is running
tell application "System Events"
set IsActive to ((application processes whose (name is equal to "Daylite")) count)
end tell

#important
if incomingNumber = missing value then
set incomingNumber to ""
end if

if IsActive is not 0 then
tell application "Daylite"
# tell Daylite that there is an incomingCall from
# incomingNumber. "applscpt" triggers the Apple-
# Script Phone Plugin. The third argument MUST be
# an empty String
incomingCall {"applscpt", incomingNumber, ""}
end tell
end if