Sample Plugins (included in the download)
Code:
; Install files into plugins/helloworld
; Restart RedStone
; type: *hello world
#include CR_PluginClient.ahk
helloWorld_Initialize() {
CommandRegister("Hello World", "helloWorld_Command")
}
helloWorld_Command(A_Command, A_Args) {
MsgBox,Hello World
}
Miro Plugin (Mozilla Media Application)
Code:
#include CR_PluginClient.ahk
miro_Initialize() {
CommandRegister("Miro Command", "miro_Command")
}
miro_Command(A_Command, A_Args) {
entry := syslist_Get("Windows", "/filter:name=Miro")
if (entry <> "") {
wid := getValue(entry, "wid")
WinGet, pid, PID, ahk_id %wid%
WinActivate, ahk_pid %pid%
SetKeyDelay, 0, 25
command := getValue(A_Args, "args")
if (command = "Play") {
ControlSend,MozillaWindowClass1,^{Space},ahk_id %wid%
} else if (command = "Pause") {
ControlSend,MozillaWindowClass1,^{Space},ahk_id %wid%
} else if (command = "Stop") {
ControlSend,MozillaWindowClass1,^D,ahk_id %wid%
} else if (command = "Next") {
ControlSend,MozillaWindowClass1,^{Right},ahk_id %wid%
} else if (command = "Rewind") {
ControlSend,MozillaWindowClass1,^{Left},ahk_id %wid%
} else if (command = "Forward") {
ControlSend,MozillaWindowClass1,{Right},ahk_id %wid%
} else if (command = "Back") {
ControlSend,MozillaWindowClass1,{Left},ahk_id %wid%
} else if (command = "Fullscreen") {
ControlSend,MozillaWindowClass1,!{Enter},ahk_id %wid%
}
WinActivate, RedStone
}
}