Dialectic AppleScript Dial Method Scripts

Introduction
Dialectic supports many phones & services “out of the box” but if there is a service or device that it does not support directly, you may be able to use the AppleScript Dial Method to send the dialing information from Dialectic to your unsupported phone device/service. When using the AppleScript Dial Method, you simply specify a script to use and Dialectic will launch that script at dial time and pass the call parameters to the script to handle. If your script returns a boolean true value, then Dialectic will consider the call a success and add it to the call log. Returning a value of false will tell Dialectic that the call failed and it will not be added to the call log.

To create a script for use with the AppleScript Dial Method, simply create a new AppleScript in the Script Editor (or the AppleScript IDE of your choice) and include the following subroutine (adding your own call handling code, of course):

on handle_dial_action(contact_number, contact_name, call_type, dial_method, transformed_number)
	try

		--handle the call with your device or service here

	on error the_error number error_number
		return {false, the_error & " (" & error_number & ")"}
	end try
	return true
end handle_dial_action

Save your script as a compiled AppleScript. Once saved, follow these directions to use the script as the AppleScript Dial Method in Dialectic.

1. In Dialectic, go to Preferences > Dial Methods.
2. Expand the AppleScript folder and select the “AppleScript Default” configuration.
3. In the configuration pane on the right, select the “Choose Script” button and choose the script you saved above (you can put this script anywhere you want on your hard drive before selecting it).
4. Click the Dialing Rules button at the top of the preferences window.
5. In the call type section, change the Dial Method to “AppleScript”.
6. Click the blue button to the right of the configuration menu to set this Dial Method configuration for all call types.
7. Set your Dialing Rules as necessary to transform your numbers as required.
8. Dial a number from Dialectic.

Any feedback you may have is appreciated.

Requirements
Mac OS X 10.4 or later & Dialectic

Warranty
This software is provided on an “AS IS” basis, without warranty of any kind, either expressed or implied, including, without limitation, warranties that the subject software is free of defects, merchantable, fit for a particular purpose or non-infringing. JNSoftware LLC assumes no risk as to the quality and performance of the software. Should the software prove defective in any respect, JNSoftware LLC assumes no cost or liability for any servicing, repair or correction. This disclaimer of warranty constitutes an essential part of this license. No use of any subject software is authorized hereunder except under this disclaimer.

Under no circumstances and under no legal theory, whether tort (including, without limitation, negligence or strict liability), contract, or otherwise, shall JNSoftware LLC be liable for any direct, indirect, special, incidental, or consequential damages of any character with respect to the software including, without limitation, damages for loss of goodwill, work stoppage, loss of data, computer failure or malfunction, or any and all other commercial damages or losses, even if JNSoftware LLC shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability resulting from JNSoftware LLC’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so that exclusion and limitation may not apply to you.

You may distribute this software so long as you distribute the complete package including this Read Me document.

Copyright © 2011 JNSoftware LLC. All Rights Reserved.