main.pas
if name = 'rename' then
if renameFile(p, par(1))
and not stopOnMacroRename then // should we stop recursion?
try
// by default, we'll stop after first stacked [on macro rename], but recursive=1 will remove this limit
stopOnMacroRename:=isFalse(par('recursive'));
runEventScript('on macro rename', toSA(['%old-name%',p,'%new-name%',par(1)]));
spaceIf(TRUE);
finally
stopOnMacroRename:=FALSE;
end
else result:=''; // add by mars
Else ....when a rename failed, the macro is replaced by
<div class=macroerror>macro error: ' ...