As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
var fileNames = space.children; function main(){ for (i=0; i<fileNames.length; i++){ logger.log(fileNames.properties.content.mimetype); if(fileNames.isDocument && (fileNames.properties.content.mimetype).equals("text/plain")){ //document.childAssocs var fileAttachments = fileNames.assocs['cm:attachments'][1]; logger.log(i+" - "+fileNames.assocs['cm:attachments']); } }; /* for (i=0; i<fileAttachments.length; i++){ logger.log("==================================================="); logger.log(fileAttachments); }; */ } main();
var fileName = space.children; function main(){ for (i=0; i<fileName.length; i++){ if(fileName.isDocument && (fileName.properties.content.mimetype).equals("text/plain")){ logger.log(fileName.properties.name); var fileAttachments = fileName.assocs['cm:attachments']; var spaceName = space.createFolder(fileName.properties.name+" -email"); var backupFolder = space.childByNamePath(spaceName.properties.name); fileName.move(backupFolder); var myFolder = space.children; for ( var j in fileAttachments){ logger.log(fileAttachments[j].name); for(x=0; x<myFolder.length; x++){ if((myFolder[x].properties.name).equals(fileAttachments[j].name)){ (myFolder[x]).move(backupFolder); break; } } }; break; } }; } main();