I currently have a script expression which checks a directory for a folder with the name beginning with the name of the file passed through it. I use this in the Set Hierarchy element and it will put the matching folder into the hierarchy. For example, if I have a file named "ABC123.tif" would be put into a folder named "ABC123 ANYTHING". While handy, this is not what I am trying to do in this particular flow.
Here is the script:
Code: Select all
var folder = new Dir("/Volumes/intheworks/Jobs/Enfocus Switch/Hierarchy Test");
var dirList = folder.entryList("*",Dir.Dirs,Dir.Name);
var destinationFolder = "";
for (var i=0; i<dirList.length; i++) {
if (dirList[i].startsWith(job.getNameProper()) == true) {
destinationFolder = dirList[i];
}
}
destinationFolder;
Thank you in advance.
Danny