iRed itself may be controlled from the outside. This comes very handy if you want to send IR codes from other applications. There are three methods to achieve this which are listed below.
As an simple example look at this very short AppleScript which tells iRed to send the IR code "Power" to the remote control "Sony":
|tell application "iRed" to send ir Code "Power" of RC "Sony"|
This is the shortest possible form of an AppleScript, but does not include any error handling. More explicit examples can be found inside the folder "AppleScript" of the installation package of iRed.
The names of codes and remote controls are configured on the inspector window. AppleScript is not very good in dealing with special characters like the power sign in the example below. To name those codes you may use the text field "AppleScript Name" as shown in this screenshot::
Another way to control iRed is by using the command line program "ired", which is part of the iRed package as well.
This is how it looks like to call the IR code from the example above:
|ired -send "Sony" "Power"|
This gives you the opportunity to integrate iRed into your workflow. See this chapter for some details
This is the technically most advanced way to remote control iRed. I must apologize that I give no technical details on TCP sockets here.
Please see folder Extras inside the iRed installation package for examples, perl script in particular.
Im Ordner Extras des iRed-Pakets finden Sie Beispiele, insbesondere Perl-Scripts, die einen Zugriff über Sockets zeigen.
To enable iRed's listening for sockets, go to Preferences/Network:
Very briefly: to send out a IR code by iRed, call:
|SEND_ONCE Sony Power|
Please note that no whitespaces or special characters are allowed. The field "AppleScript Name" on Inspector will be used if present.
To call AppleScripts as well as keystroke actions:
|CALL_ONCE iTunes NextAlbum|
|Last update: April 20, 2006|