// Import the MacroHandlerimport com.rapidminer.MacroHandler;// Get the Macro HandlerMacroHandler handler = operator.getProcess().getMacroHandler();// Get the Macro with the name "path"String macro = handler.getMacro("path");// Tokenize the macro by the delimiter \List tokens = macro.tokenize("\\");// Get the last token (the folder)String folder = tokens.get(tokens.size()-1);// Add a new macro named folderhandler.addMacro("folder",folder);