Rename and copy

Try this. Are you sure you want everything copied to C:\?

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    cmd.deselect = false;

    var currDate = DOpus.Create().Date();
    currDate.Sub(1, 'd');
    var dateStr = currDate.Format('D#yyyy_MMdd');

    for (var e = new Enumerator(tab.selected_files); !e.atEnd(); e.moveNext()) {
        var item = e.item();
        cmd.RunCommand('Copy FILE="' + item + '" AS="' + item.name_stem + '_' + dateStr + item.ext + '" TO="C:\\"');
    }
}

Copy Yesterday.dcf (1.2 KB)