Hello All,
Is it possible to check if a file exists in a repository before injecting it.
I have a hold node that I want to be conditionally released to the inject file node if the specific file to inject is available.
Thanks
check if file exists
Re: check if file exists
Figured it out:
function getFileStatus() : string {
var fPath = full path to file including file name';
var fa = new File(fPath);
if ( fa.exists ){
return true;
}
else{
return false;
}
}
getFileStatus();
function getFileStatus() : string {
var fPath = full path to file including file name';
var fa = new File(fPath);
if ( fa.exists ){
return true;
}
else{
return false;
}
}
getFileStatus();
Re: check if file exists
Thanks for sharing your solution. I think you could also do this with two injects if you didn't have the scripting module. One to inject the file as a copy leaving the original in place, the second to run it into whatever use case you wanted to use the original inject for. If the first inject failed, you could assume the file doesn't exist.
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix