As you dial, the number provided can be preprocessed with an AppleScript before passing through the rest of the Dialing Rules and on to Dialectic for dialing.
You specify the script to be used for preprocessing in the Dialing Rules by checking the “Preprocess AppleScript:” control and then choosing the script file. You can also simply drag and drop your script into the script path field. If you no longer want to use the specified preprocessing script, uncheck the “Preprocess AppleScript:” checkbox. For example scripts that can be used with Dialectic as a preprocessing script (and other items), see the Dialectic Online Resources at:
http://www.jonn8.com/dialectic/resources/
The preprocessing script must contain the handle_preprocess_number_action handler using the following format:
This format accepts a single parameter, the_number, which is the number Dialectic has been asked to dial. Your script should transform this number as necessary and then return the result to Dialectic to continue processing. The returned result can be one of two things:
- A string, representing the number as you want it handed on to Dialectic. In this case Dialectic will continue as if the processed number is what it was originally handed; it will work out the call type based on this string, and will proceed to dial accordingly.
- A list, consisting of two items:
- The keyword false.
- A string, representing the number as you want handed on to Dialectic. In this case Dialectic will interpret and process the number as if it were a Literal call.
As an example, here is a script for stripping all formatting other than digits:
This next example will test to see if the number starts with a specified country code and, if so, return the number and tell Dialectic that this should be treated as a Literal call: