Just before Dialectic begins to dial, after a number has been processed by the Dialing Rules, 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 called party, cancel the call based on some specific criteria such as time of day, etc. or just about anything else. AppleScript is powerful!
To specify that this should be done, create and save your script, and then, in the Dialing preferences, check “Launch Application or AppleScript Before Dialing” 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 a before dialing script (and other items), see the Dialectic Online Resources at:
http://www.jonn8.com/dialectic/resources/
The Before Dialing AppleScript must contain the handle_predial_action handler using the following format:
The parameters of the handle_predial_action handler will be passed by Dialectic to your script just before the number is actually dialed. These parameters are:
- contact_number The number Dialectic was asked to dial as a string, in raw form, exactly as it was asked to dial it.
- contact_name The name of the contact as a string (if unavailable, this will be a blank string).
- call_type The type of call as interpreted by Dialectic: Internal, Local, Long-Distance, etc. as a plain string.
- dial_method The Dial Method used by Dialectic as a string in accordance with the type of call (see previous parameter) and your current Location; this will be “AppleScript Dial Method” (since if it were not, we would not be running this script in the first place!) followed by the name of the specific configuration.
- transformed_number The phone number to dial as a string as transformed by the current Location’s Dialing Rules. For example, if this is an external call and you have specified that Dialectic should dial “9,” to reach an outside line, “9,” will be prefixed to the original contact number as part of the transformed number.
Your script should return true if the call should be dialed; return false if the call should be cancelled.