IRed has worked very well for several years. However, while I still can send IR to IRed via the IR Trans, I seem to have lost the ability to send from Indigo scripts. Oddly, i looked and my tuner device and its codes were no longer in the iRed app, and I had to find an archived version of it. They are now back in IRed, and when I press a "test" button within the action window it will send the command to the IRTrans and work properly. However, my Indigo scripts no longer work. Here's what I've been using. These commands are executed in a trigger when a control page button press changes a variable.
Any advice would be appreciated.
- Code: Select all
using terms from application "IndigoServer"
on RemoteControl(TheRemote, TheDevice, irCode)
with timeout of 3 seconds
try
tell application "iRed2" to perform action Code irCode of Device TheDevice of Remote TheRemote
--I also tried this syntax based on Robert's advice above:
tell application "iRed2" to perform action (Code irCode of Device TheDevice) using module Remote TheRemote using led "internal"
on error
tell application "IndigoServer"
log "Error - Could not transmit to iRed2 --> Device: " & TheDevice & ", code: " & irCode using type "iRed:"
end tell
end try
end timeout
end RemoteControl
tell application "IndigoServer"
if value of variable "WHA_Radio_Preset" is "1" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_1"
RemoteControl("Sony Tuner", "Sony/Tuner", "1")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "2" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_2"
RemoteControl("Sony Tuner", "Sony/Tuner", "2")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "3" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_3"
RemoteControl("Sony Tuner", "Sony/Tuner", "3")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "4" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_4"
RemoteControl("Sony Tuner", "Sony/Tuner", "4")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "5" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_5"
RemoteControl("Sony Tuner", "Sony/Tuner", "5")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "6" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_6"
RemoteControl("Sony Tuner", "Sony/Tuner", "6")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "7" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_7"
RemoteControl("Sony Tuner", "Sony/Tuner", "7")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "8" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_8"
RemoteControl("Sony Tuner", "Sony/Tuner", "8")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "9" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_9"
RemoteControl("Sony Tuner", "Sony/Tuner", "9")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "10" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_10"
RemoteControl("Sony Tuner", "Sony/Tuner", "1")
RemoteControl("Sony Tuner", "Sony/Tuner", "0")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "11" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_11"
RemoteControl("Sony Tuner", "Sony/Tuner", "1")
RemoteControl("Sony Tuner", "Sony/Tuner", "1")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
if value of variable "WHA_Radio_Preset" is "12" then
set value of variable "WHA_Radio_Display" to value of variable "WHA_FM_Preset_12"
RemoteControl("Sony Tuner", "Sony/Tuner", "1")
RemoteControl("Sony Tuner", "Sony/Tuner", "2")
RemoteControl("Sony Tuner", "Sony/Tuner", "Enter")
end if
end tell
end using terms from