When an incoming call has been detected, Dialectic can run an AppleScript. This can be used to pause a media player not natively supported by Dialectic (such as VLC, an Internet radio application, etc.), to create your own call log or add the call to a database, open a database record associated with the calling party, or just about anything else. AppleScript is powerful!
To specify that this should be done, create and save your script, and then, in the incoming call actions preferences, check “Launch Application or AppleScript” and choose the script file. You can also drag and drop your script onto the script path area to specify it as the script to use. For example scripts that can be used with Dialectic as an incoming call script (and other items), see the Dialectic Online Resources at:
http://www.jonn8.com/dialectic/resources/
The Incoming Call AppleScript must contain the handle_incoming_call_action handler using the following format:
The parameters of the handle_incoming_call_action handler will be passed by Dialectic to your script just after a call is detected. These parameters are:
- contact_name The name (if available from caller ID on the monitored device) of the calling party as a plain string.
- contact_number The number (if available from caller ID on the monitored device) of the calling party as a plain string.
- phone_or_modem_name The name of the device being monitored (e.g., your Bluetooth mobile phone’s name) as a plain string.
Your script does not need to return any specific result. However, if you enable the option to “Run Before Other Actions” and you return a record with one or more values for contact_name, contact_number, phone_or_modem_name, then those values will be used by the rest of the actions. For example, if your script modifies the contact_number and you return a record of {contact_number:contact_number}, then the modified contact_number value will be used for other actions such as the caller ID lookup, alerts, the call log, etc.