private void executeScript() {
		Script.clean();
		Script.loadScript(cScript.readScriptFile(getScriptFile()));
		Iterator<DeviceCommandMessage> it = null;
		it = Script.getMessages().iterator();

		index = -1;

		while (it.hasNext()) {

			index++;

			DeviceCommandMessage d = it.next();
			if (d instanceof KeyCommandMessage) {
				KeyCommandMessage km = ((KeyCommandMessage) d);
				client.sendMessage(km);
				if (km.getKeyCommandType() == KeyCommandMessageType.KEY_UP) {
					wait4Action(1);
				}
			} else if (d instanceof TouchCommandMessage) {
				TouchCommandMessage tm = ((TouchCommandMessage) d);
				client.sendMessage(tm);
				if (tm.getTouchCommandType() == TouchCommandMessageType.TOUCH_UP) {
					wait4Action(1);
				}
			} else if (d instanceof ScriptCommandMessage) {
				ScriptCommandMessage sm = ((ScriptCommandMessage) d);
				if (sm.getActionType() == ScriptCommandMessageType.SLEEP) {
					wait4Action(Long.valueOf(sm.getTimeSeg()));
				} else if (sm.getActionType() == ScriptCommandMessageType.PAUSE) {

					scriptVisualization.setSelectedIndex(index);
					scriptVisualization.ensureIndexIsVisible(index);

					JOptionPane.showMessageDialog(null, "Continue...");

					scriptVisualization.clearSelection();
				}
			}
		}

		index = -1;
	}