Here is some sample method code (client-side, Javascript) to open a file browser and read the selected file. This code then attempts to apply the contents of the file (assuming it is AML) and returns either an error or record count.
var inn = this.newInnovator();var fileName = top.aras.vault.SelectFile();var aml = top.aras.vault.ReadText(fileName);var resultItem = inn.applyAML(aml);if (resultItem.isError()) { return "Error: " + resultItem.getErrorDetail();} else { return "Success: " + resultItem.getItemCount() + " Items created";}