The following example shows, how to get the name of a command can be read from a macro and can be inserted in an other macro.
Example:
// Get a SFormattedField from a window SFormattedField field = (SFormattedField)window.getComponent("KomponentenName"); // Get the name of the command, that is in the MouseClickedMacro of the component String macro = field.getMouseClickedMacro(); // Set the command in the macro MouseEnteredMacro. field.setMouseEnteredMacro(macro);