function markRRA()

in misc/RRACodeMaster.js [39:59]


function markRRA(ev) {
  // Get new values for footer
  var  time = new Date();
  time = Utilities.formatDate(time, "GMT-00:00", "YYYY-MM-dd hh:mm:ss");
  var user = Session.getActiveUser().getEmail();
  
  // Setup new footer
  var doc = DocumentApp.getActiveDocument();
  var ftr = doc.getFooter();
  var txt = 'Rapid Risk Analysis is a lightweight risk and threat modeling framework.\rRRA was last reviewed at DATE by USER';
  var style = {};
  style[DocumentApp.Attribute.FONT_SIZE] = 8;
  style[DocumentApp.Attribute.ITALIC] = true;
  style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.CENTER;
  
  // Replace/set values
  ftr.setText(txt);
  ftr.replaceText('DATE', time);
  ftr.replaceText('USER', user);
  ftr.getChild(0).setAttributes(style);
}