Dialectic Icon

Incoming Call AppleScript Format

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:

script icon
on handle_incoming_call_action(contact_name, contact_number, phone_or_modem_name)
     try
 
               -- do something here...
          
     on error the_error
          activate
          display dialog "Error: " & the_error buttons {"OK"} default button 1 with icon 0 giving up after 20
     end try
 
     (*
     if you enable "Run Before Other Actions" in the notifications preferences, you may
     optionally return a record of one or more of the contact_name, contact_number,
     phone_or_modem_name values. If you do this, those return values will be used by
     the subsequent incoming call actions. This is helpful if this script modifies the contact_number,
     for example.
     *)
     return {contact_name:contact_name, contact_number:contact_number, phone_or_modem_name:phone_or_modem_name}
end handle_incoming_call_action

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:

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.

Open

Open Notifications

Related Topics

Incoming Call Actions

Online Resources

Was this page helpful? Were there errors, inaccuracies, or typos?
Could something have been explained better? If so, please let us know. 

Copyright © 2017 JNSoftware LLC. All Rights Reserved.
All other products mentioned are copyright of their respective owners.
No endorsement of or affiliation with any third-party product or service is implied.