Page 1 of 1
Access Stats.* in script
Posted: Wed Mar 14, 2018 4:37 pm
by mclarke
I'm trying to write my first script, which checks whether the NumberOfPages stat is divisible by four (4). I can't figure out how to get access to the stats of the file.
Does anyone have a sample script I could learn from that does the check? I was going tol use modulo and return a Boolean result.
Thanks in advance.
Re: Access Stats.* in script
Posted: Wed Mar 14, 2018 5:10 pm
by jan_suhr
Re: Access Stats.* in script
Posted: Wed Mar 14, 2018 9:20 pm
by mclarke
Thanks, that was helpful.
Re: Access Stats.* in script
Posted: Fri Mar 16, 2018 12:52 pm
by allsystems
var numberOfPages = job.getVariableAsNumber("[Stats.NumberOfPages]");
var modOperator = 4;//this is the number of pages you want to check
var modCheck = false;//set the check to false
if(numberOfPages%modOperator==0){
modCheck = true;
}
Re: Access Stats.* in script
Posted: Fri Mar 16, 2018 8:53 pm
by mclarke
Thanks AllSystems. I will try that one out, also!
Re: Access Stats.* in script
Posted: Mon Mar 19, 2018 3:32 pm
by gabrielp
Re: Access Stats.* in script
Posted: Tue Mar 20, 2018 8:38 pm
by mclarke
I'll check it out, thanks.