Using AppleScript, it is very easy to command Dialectic to dial a number. Below you will find the basic commands for dialing and then several examples for how to write more complex scripts using variable data for the number to dial. For all of the example scripts provided below, click the small script icon in the top left corner of the example box to open the example code as a new script in the Script Editor application.
For more scripts and other items, see the Dialectic Online Resources at:
http://www.jonn8.com/dialectic/resources/
Here are the three basic dialing commands:
--
tell application "Dialectic" to dial number "212-555-1212"
--
tell application "Dialectic" to dial number "212-555-1212" name "NYC Information"
--
tell application "Dialectic" to dial number "9,12125551212" name "NYC Information" with literal
Using the basic dial command, you can get use more complex scripts to identify the number to actually dial. Here are a few examples. Prompt the user for the number to dial:
set the_number to "(212) 555-1212"
set the_number to text returned of (display dialog "What number shall I dial?" default answer the_number)
tell application "Dialectic" to dial number the_number
Dial the contents of the clipboard:
set the_number to (the clipboard)
tell application "Dialectic" to dial number the_number
Dial the contents of a cell in a FileMaker Pro database:
property cell_name : ""
repeat while cell_name = ""
try
set cell_name to text returned of (display dialog "What cell name should I use?" default answer cell_name buttons {"Cancel", "OK"} default button 2 with icon 1)
on error
return --
end try
end repeat
try
tell application "FileMaker Pro" to set the_number to cellValue of cell cell_name of current record of document 1
on error the_error
set cell_name to ""
beep
return display dialog the_error buttons {"OK"} default button 1 with icon 0 giving up after 10
end try
tell application "Dialectic" to dial number the_number
Dial the currently selected text in Safari 3.x with tabs enabled:
tell application "Safari"
activate
delay 1
set the_number to do JavaScript "getSelection();" in current tab of (item 1 of (windows whose document of it is not missing value))
end tell
tell application "Dialectic" to dial number the_number