Routing Expression
Posted: Wed Nov 06, 2013 1:48 pm
I am trying to write a script expression to move PDFs to the correct Pitstop Preflight profile. It looks at the trim size of the PDF and compares it to a XML ticket.
I get an error when I try to run this, it won't convert my XML metadata to a number to compare.
Error in line 8 of script : TypeError. Undefined member function 'unknown' for object '3.5' of type: 'Number'
var jh = job.getVariableAsNumber('[Stats.TrimboxHeight]')
var jw = job.getVariableAsNumber('[Stats.TrimboxWidth]')
var th = job.getVariableAsNumber('[Metadata.Text:Path="/notification/order/orderItem/orderItemPrintJob/finishedHeight",Dataset="Xml",Model=XML]')
var tw = job.getVariableAsNumber('[Metadata.Text:Path="/notification/order/orderItem/orderItemPrintJob/finishedWidth",Dataset="Xml",Model=XML]')
((jh > jw && th > tw) || (jh tw))
Thanks
Andy
I get an error when I try to run this, it won't convert my XML metadata to a number to compare.
Error in line 8 of script : TypeError. Undefined member function 'unknown' for object '3.5' of type: 'Number'
var jh = job.getVariableAsNumber('[Stats.TrimboxHeight]')
var jw = job.getVariableAsNumber('[Stats.TrimboxWidth]')
var th = job.getVariableAsNumber('[Metadata.Text:Path="/notification/order/orderItem/orderItemPrintJob/finishedHeight",Dataset="Xml",Model=XML]')
var tw = job.getVariableAsNumber('[Metadata.Text:Path="/notification/order/orderItem/orderItemPrintJob/finishedWidth",Dataset="Xml",Model=XML]')
((jh > jw && th > tw) || (jh tw))
Thanks
Andy