I know I can use Pitstop Server preflights to check for an odd number of pages in a document but I'm looking to keep things tidy and do it with a branch of a flow using Stats.NumberOfPages (see attached).
Do anybody know/care to share how I could do that via the scripting expression?
TIA
[SOLVED] Check for odd number of pages
[SOLVED] Check for odd number of pages
- Attachments
-
- Screenshot 2020-09-17 at 10.55.55.png (21.9 KiB) Viewed 4579 times
Last edited by abonsey on Thu Sep 17, 2020 2:59 pm, edited 1 time in total.
Re: Check for odd number of pages
Off the top of my head I can't figure out doing it through Define conditions with variables, but doing it fully in a Script expression on a connection would be done like this:
Code: Select all
var numberOfPages = (new FileStatistics(job.getPath())).getNumber("NumberOfPages");
(numberOfPages % 2 == 0);
Re: Check for odd number of pages
FYI
Got there in the end
[Switch.Calculation:Expression="([Stats.NumberOfPages]%2)"]
Got there in the end
[Switch.Calculation:Expression="([Stats.NumberOfPages]%2)"]
Re: Check for odd number of pages
Ah! Can't believe I didn't think of that