Try this.
#target photoshop
var doc = activeDocument;
var oldPrefs = app.preferences.rulerUnits
app.preferences.rulerUnits = Units.PIXELS;
var dH = doc.height.value;
var splits = parseInt( dH/2000 + 1);
var sliceAmt = dH/splits
for (var i=0;i<splits;i++){
if(i + 1 == splits){
sliceImg (i*sliceAmt, 0, doc.height.value, doc.width.value)
}
sliceImg (i*sliceAmt, 0, (i+1) * sliceAmt, doc.width.value)
}
app.preferences.rulerUnits = oldPrefs;
function sliceImg(topS, leftS, bottomS, rightS){
var idMk = charIDToTypeID( "Mk " );
var desc4 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idslice = stringIDToTypeID( "slice" );
ref1.putClass( idslice );
desc4.putReference( idnull, ref1 );
var idUsng = charIDToTypeID( "Usng" );
var desc5 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var idsliceType = stringIDToTypeID( "sliceType" );
var iduser = stringIDToTypeID( "user" );
desc5.putEnumerated( idType, idsliceType, iduser );
var idAt = charIDToTypeID( "At " );
var desc6 = new ActionDescriptor();
var idTop = charIDToTypeID( "Top " );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idTop, idPxl, topS );
var idLeft = charIDToTypeID( "Left" );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idLeft, idPxl, leftS );
var idBtom = charIDToTypeID( "Btom" );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idBtom, idPxl, bottomS );
var idRght = charIDToTypeID( "Rght" );
var idPxl = charIDToTypeID( "#Pxl" );
desc6.putUnitDouble( idRght, idPxl, rightS );
var idRctn = charIDToTypeID( "Rctn" );
desc5.putObject( idAt, idRctn, desc6 );
var idslice = stringIDToTypeID( "slice" );
desc4.putObject( idUsng, idslice, desc5 );
executeAction( idMk, desc4, DialogModes.NO );
}