-
1. Re: Syntax for a Custom Boolean Function.
GKaiseril Oct 3, 2012 12:07 PM (in response to MaxCO2012)You could return the "FileExists" value.
var VerifyFileExists = app.trustedFunction( function(File_Name)
{
app.beginPriv();
global.FileExists = true;
try{
oDoc = app.openDoc({
cPath: File_Name,
bHidden: true
})
FileExists = true
oDoc.closeDoc();
}catch(e){
FileExists = false
}
app.endPriv();
return FileExists;
});
-
2. Re: Syntax for a Custom Boolean Function.
MaxCO2012 Oct 3, 2012 12:21 PM (in response to GKaiseril)Yes, that's what I'm doing now. But it causes an additional line of code because I have to first pass the File_Name to the function and then check the value of FileExists, like this:
VerifyFileExists("Allowance Schedule.pdf");
if (FileExists == true) myDoc.insertPages({nPage:myDoc.numPages-1, cPath:"Allowance Schedule.pdf"});
What I want to do is more like:
If(VerifyFileExists("Allowance Schedule.pdf") myDoc...
Thanks!


