Dialectic Icon

Other

In addition to configuring & dialing Dialectic using AppleScript, the application supports many other scripting commands. For instance, with scripting it is possible to access Dialectic’s alert windows or the large type window used with the Address Book menu selection actions to display your own custom messages. You can also integrate Dialectic with other applications to access its incoming call notification system to allow Dialectic to be the single hub for all of your phone activities, even if it can’t monitor a specific device or service natively.

Below are just a few examples of what you can do with Dialectic via AppleScript. 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/

script icon
on show_message(the_message, the_icon)
     --requires that Dialectic allow external AppleScript access in the Miscellaneous preferences section     
     --the_message is a string, the_icon is an alias or sting path to a file for the icon or a name of an image in Dialectic
     tell application "Dialectic" to show message the_message icon the_icon
end show_message
script icon
on show_large_type(the_message)
     --requires that Dialectic allow external AppleScript access in the Miscellaneous preferences section
     tell application "Dialectic" to show large type the_message
end show_large_type
script icon
set the_sender to "My Phone"
set caller_number to "2125551212"
set caller_name to "Unknown"
set is_incoming to true
set the_note to "Note for Log."
set flag_entry to false
set show_message_in_dialectic to true
my add_call_log_entry(the_sender, caller_number, caller_name, is_incoming, the_note, flag_entry, show_message_in_dialectic)
 
set is_incoming to false
my add_call_log_entry(the_sender, caller_number, caller_name, is_incoming, the_note, flag_entry, show_message_in_dialectic)
 
on add_call_log_entry(the_sender, caller_number, caller_name, is_incoming, the_note, flag_entry, show_message_in_dialectic)
     tell application "Dialectic"
          set added_entry to add call log entry number caller_number name caller_name incoming is_incoming note the_note flagged flag_entry
          if not added_entry then return false --Dialectic is not accepting external log entries
          if show_message_in_dialectic then
               if is_incoming then
                    show message "Incoming call from " & caller_name & " (" & caller_number & ") detected by " & the_sender & "." icon "dialectic"
               else
                    show message "Outgoing call to " & caller_name & " (" & caller_number & ") made by " & the_sender & "." icon "dialectic"
               end if
          end if
          return true
     end tell
end add_call_log_entry
script icon
tell application "Dialectic"
     return properties of call log entries whose note is not ""
end tell
script icon
set the_sender to "My Phone"
set caller_number to "2125551212"
set caller_name to ""
my handle_incoming_call(the_sender, caller_number, caller_name)
 
on handle_incoming_call(the_sender, caller_number, caller_name)
     if (caller_number = "") then set caller_number to "Unknown Number"
     if (caller_name = "") then set caller_name to "Unknown Caller"
     tell application "Dialectic"
          set call_added to call detected number caller_number name caller_name device the_sender
          if not call_added then return false -- Dialectic is not accepting external scripts
          return true
     end tell
end handle_incoming_call
script icon
set mnemonic_phone_number to "1-800-SOME-NUM"
my convert_mnemonic(mnemonic_phone_number)
-->"1-800-7663-686"
 
on convert_mnemonic(mnemonic_phone_number)
     tell application "Dialectic" to convert mnemonic mnemonic_phone_number
end convert_mnemonic
script icon
on get_available_components()
     tell application "Dialectic" to return {the_modems:list devices, the_softphones:list softphones, the_sources:list lookup sources}
end get_available_components
 
on get_locations()
     tell application "Dialectic" to return name of locations
end get_locations
 
on get_current_location()
     tell application "Dialectic" to return name of item 1 of (get locations whose current = true)
end get_current_location
 
on get_dial_method_configurations()
     tell application "Dialectic" to return {AppleScript_Dial_Method_configurations:name of AppleScript Dial Method configurations, Asterisk_Dial_Method_configurations:name of Asterisk Dial Method configurations, Bluetooth_Phone_Dial_Method_configurations:name of Bluetooth Phone Dial Method configurations, BroadVoice_Dial_Method_configurations:name of BroadVoice Dial Method configurations, CallVantage_Dial_Method_configurations:name of CallVantage Dial Method configurations, Cisco_IP_Phone_Dial_Method_configurations:name of Cisco IP Phone Dial Method configurations, FRITZBox_Dial_Method_configurations:name of FRITZBox Dial Method configurations, Dialectic_Remote_Dial_Method_configurations:name of Dialectic Remote Dial Method configurations, Modem_Dial_Method_configurations:name of Modem Dial Method configurations, Phlink_Dial_Method_configurations:name of Phlink Dial Method configurations, PhoneValet_Dial_Method_configurations:name of PhoneValet Dial Method configurations, Softphone_Dial_Method_configurations:name of Softphone Dial Method configurations, Speakeasy_Dial_Method_configurations:name of Speakeasy/MegaPath Dial Method configurations, Speaker_Dial_Method_configurations:name of Speaker Dial Method configurations, URL_Dial_Method_configurations:name of URL Dial Method configurations, ViaTalk_Dial_Method_configurations:name of ViaTalk Dial Method configurations, Vonage_Dial_Method_configurations:name of Vonage Dial Method configurations}
end get_dial_method_configurations
 
on get_qdn()
     tell application "Dialectic" to return {phone number, name} of quick dial numbers
end get_qdn
 
on get_rdn()
     tell application "Dialectic" to return {phone number, name} of recently dialed numbers
end get_rdn
script icon
property base_duration : 0.2 --in seconds
property pause_duration : 0.5 --in seconds
property last_number : ""
try
     set last_number to text returned of (display dialog "Enter number to play as touchtones:" default answer last_number buttons {"Cancel", "OK"} default button 2 with icon 1)
     repeat with i in (last_number's characters)
          ignoring case
               if i = "," then
                    do shell script "sleep " & pause_duration
               else if i is in "1234567890*#abcdefghijklmnopqrstuvwxyz" then
                    tell application "Dialectic" to play tone i duration base_duration
               end if
          end ignoring
     end repeat
end try

Open

Open Script Editor

Open Dialectic's AppleScript Dictionary

Related Topics

Online Resources

AppleScript

Configuring with AppleScript

Dialing with AppleScript

Internal Script Formats

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.