OL Learn

Basic conditions in workflow

Hoping someone can assist here - I’m trying to set up a workflow that determines the number of pages in a pdf, then based on this number can branch to different templates.

It seems like the only options I have are filename/size condition, and text condition, which seems to only look in the data file (the data file and picked up pdf are separate files).

I’ve been trying to use this script after picking up the pdf:
> Set MyPDF = Watch.GetPDFEditObject
> MyPDF.Open Watch.GetJobFileName, False
> Watch.SetJobInfo 9,MyPDF.Pages.Count

Then I had hoped text condition could pick up %9 and read it, but it only seems able to test the data file.

Does anyone know how I attach a really simple true/false branch testing jobinfo fields?

Thank you.

Here’s how you would configure the text condition to check if %9 contains a value of 100 or higher:

If that doesn’t work, then it might be because %9 doesn’t actually contain the number of pages in the PDF so you might want to check for a typo in your script.

Here’s the JavaScript code I used:

var myPDF = Watch.GetPDFEditObject();
myPDF.Open( Watch.GetJobFileName(), false );
Watch.SetJobInfo( 9, myPDF.Pages().Count() );

Thanks for your help Phil, this is exactly what I needed, I had mine stuck on the ‘isfound’ operator and didn’t realise changing that would let me compare something other than the data.

Thanks a lot.