function getDocumentBits(){
    var bits = 0;
    if (app.activeDocument.bitsPerChannel == BitsPerChannelType.ONE) bits = 1;
    if (app.activeDocument.bitsPerChannel == BitsPerChannelType.EIGHT) bits = 8;
    if (app.activeDocument.bitsPerChannel == BitsPerChannelType.SIXTEEN) bits = 16;
    if (app.activeDocument.bitsPerChannel == BitsPerChannelType.THIRTYTWO) bits = 32;
    return bits;
}
if (app.documents.length > 0) {
    if ((getDocumentBits() == 8)||(getDocumentBits() == 16)){
#target photoshop
//
// Resize.jsx
//

//
// Generated Fri Nov 04 2016 13:46:12 GMT+0500
//

cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };

//
//==================== Resize ==============
//
function Resize() {
  // Fit Image
  function step1(enabled, withDialog) {
    if (enabled != undefined && !enabled)
      return;
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    desc1.putString(cTID('Msge'), "Fit Image action settings");
    desc1.putUnitDouble(cTID('Hght'), cTID('#Pxl'), 1280);
    desc1.putUnitDouble(cTID('Wdth'), cTID('#Pxl'), 1920);
    desc1.putBoolean(sTID("limit"), true);
    executeAction(sTID('3caa3434-cb67-11d1-bc43-0060b0a13dc4'), desc1, dialogMode);
  };

  step1(true, true);      // Fit Image
};



//=========================================
//                    Resize.main
//=========================================
//

Resize.main = function () {
  Resize();
};

Resize.main();

// EOF

"Resize.jsx"
// EOF
           } else {
        alert("Active document must be 8-bit or 16-bit");
    }
} else {
    alert("At least one file must be opened");
}