This posting is older than 6 months and can contain outdated information.
Thanks for asking.
While I can't help you with anything iRed (never used it), here's how you can have Remote Buddy switch to a specific Behaviour via AppleScript:
1) Find out the unique identifier of the Behaviour you want to switch to:
http://www.iospirit.com/support/faqs/remotebuddy/category/7/Developers/entry/183/How-can-I-find-out-the-unique-identifiers-of-Behaviours-and-globally-available-actions/
2) Use the behaviourcore Applescript command to switch to the Behaviour you want, the way you want. From Remote Buddy's AppleScript dictionary:
-- cut --
behaviourcore v : Modify Behaviour handling.
Example:
tell application "Remote Buddy"
-- Tell us the name of the currently active behaviour
behaviourcore accessor "activeBehaviour"
set theIdentifier to result
-- tell us what the plainName for the Behaviour with the identifier "com.apple.iTunes" is
behaviourcore accessor "plainName" identifier theIdentifier
set thePlainName to result
-- tell us where in the menu that Behaviour is located by default
behaviourcore accessor "defaultMenuAddress" identifier theIdentifier
set theMenuAddress to result
say "The currently active behaviour has the identifier " & theIdentifier & ". It has the plain name " & thePlainName & ". And you will find it in the menu at address " & theMenuAddress & " by default."
-- Set EyeTV active (as if no other recognized app is running in the foreground and EyeTV had the highest background priority) and make RB stick to the EyeTV Behaviour until the user explicitely deactivates the Behaviour or ..
behaviourcore accessor "setActiveBehaviour" identifier "com.elgato.eyetv" useActivationEventCode "activatedInBackground" with stickyValue
-- .. we trigger auto recognition of the currently active application and pick the corresponding Behaviour!
behaviourcore accessor "triggerAutoRecognition"
end tell
behaviourcore
accessor text : Command to execute: activeBehaviour (returns the identifier of the currently active Behaviour), setActiveBehaviour (set the active Behaviour to the one specified by the identifier parameter), sticky (active Behaviour remains active until it is manually deactivated), setSticky (can be set to 0 or 1), triggerAutoRecognition (removes any set sticky flag and auto recognizes which Behaviour should currently be active), plainName (human readable name for the Behaviour identified by option identifier), defaultMenuAddress (default menu address, i.e. top.multimedia, top.games, top.system, top.applications, ...)
[identifier text] : Identifier
[stickyValue boolean] : If you are using the "setActiveBehaviour" or "setSticky" accessor, you can explicitely define whether the sticky bit is to be set. It is set by default.
[useActivationEventCode text] : One of activated (behave as if explicitely activated by the user), activatedInFront (behave as if automatically activated because the corresponding application is in front), activatedInBackground (behave as if automatically activated because the frontmost application has no corresponding Behaviour and this Behaviour has the currently highest background priority value). Default is "activated". Optional. For use with setActiveBehaviour only.
→ text or boolean : Return value depends on value of accessor.
-- / cut --
Best regards,
Felix Schwarz