Geting a Script To Focus on the Source Pane Strategically

Here are your button and the preset. The script needed a bit of fine tuning.

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

    cmd.RunCommand('Rename PRESET=TheEliteVbkupPreset');
    cmd.SetFiles(tab.selected);
    cmd.RunCommand('Select NEXT=nodeselect');
    cmd.RunCommand('Copy MOVE');
}
function OnGetNewName(getNewNameData) {
    var tmpName = getNewNameData.newname_stem;
    var tmpExt = getNewNameData.newname_ext;

    if (tmpName.slice(-7) == ' -elite') {
        tmpName = tmpName.substr(0, tmpName.length - 7);
        tmpName += ' -vbkup';
        return tmpName + tmpExt;
    }


    if (tmpName.slice(-7) == ' -vbkup') {
        tmpName = tmpName.substr(0, tmpName.length - 7);
    } else {
        tmpName += ' -vbkup';
    }
    return tmpName + tmpExt;
}

TheEliteVbkupButton.dcf (883 Bytes)
TheEliteVbkupPreset.orp (752 Bytes)


1 Like