*
* @param itemName the name of the item to send the command to
* @param commandString the command to send
*/
static public Object sendCommand(String itemName, String commandString) {
ItemRegistry registry = (ItemRegistry) ScriptActivator.itemRegistryTracker.getService();
EventPublisher publisher = (EventPublisher) ScriptActivator.eventPublisherTracker.getService();
if(publisher!=null && registry!=null) {
try {
Item item = registry.getItem(itemName);
Command command = TypeParser.parseCommand(item.getAcceptedCommandTypes(), commandString);
publisher.sendCommand(itemName, command);
} catch (ItemNotFoundException e) {
logger.warn("Item '" + itemName + "' does not exist.");
}