Trying to setup triggering Indigo from incoming caller ID from an app called Dialectic.
I see Dialectic has an AS posted on their site that would turn on a light in Indigo but
am not seeing how I might execute an Indigo action based on the incoming caller ID.
Here's their code:
- Code: Select all
(*
This script will turn on a device controlled by Indigo when an incoming call is detected.
For more information on Indigo, please see:
http://www.perceptiveautomation.com/
If you don't adjust the device_name property at the top o the script, you will be prompted for the
device to turn on each time the script is triggered.
*)
property device_name : "" -- name of device to controll
on handle_incoming_call_action(contact_name, contact_number, phone_or_modem_name)
try
my turn_on_device()
on error the_error
activate
display dialog "Error: " & the_error buttons {"OK"} default button 1 with icon 0 giving up after 20
end try
end handle_incoming_call_action
on turn_on_device()
if (my get_device_name()) = false then return
tell application "IndigoServer" to turn on device device_name
end turn_on_device
on turn_off_device()
if (my get_device_name()) = false then return
tell application "IndigoServer" to turn off device device_name
end turn_off_device
on get_device_name()
if device_name is not "" then return device_name
set all_device_names to my get_on_off_devices()
activate
set this_device_name to (choose from list all_device_names default items {item 1 of all_device_names} with prompt "Select the device to control:" OK button name "Select")
if this_device_name = false then return false
set device_name to item 1 of this_device_name
end get_device_name
on get_on_off_devices()
tell application "IndigoServer" to return name of every device whose supports on off of it = true
end get_on_off_devices
Anyone have any info on how to set that up?
Thanks,
Carl