04-19-2016 05:24 AM
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();
04-19-2016 12:42 PM
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();
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.