Search found 142 matches

by abonsey
Wed Aug 10, 2016 10:54 am
Forum: LEGACY scripting
Topic: using metadata in a new file
Replies: 6
Views: 17276

Re: using metadata in a new file- SOLVED

All working fine now. The amends to the script didn't take in the flow even after stop starting... came back to it an our later and it all processed OK with no further changes.

No on to something new :)
by abonsey
Mon Aug 08, 2016 1:28 pm
Forum: LEGACY scripting
Topic: using metadata in a new file
Replies: 6
Views: 17276

Re: using metadata in a new file

I checked the dataset name and it is "XML". After adding in the log command I get a warning about an invalid XML document. I decide to export the XML to a new dataset and get the script to read that newly created dataset but it still errors. All this is done within the flow and it is being...
by abonsey
Fri Aug 05, 2016 11:46 am
Forum: LEGACY scripting
Topic: using metadata in a new file
Replies: 6
Views: 17276

Re: using metadata in a new file

Hi Freddy, Thanks for that, but I must be missing it still as the changes still error. Here's what I've got: var dataset = job.getDataset("XML"); var xml = new Document(dataset.getPath()); var JobCode = xml.evalToString("/Job/@JobCode"); var textFile = new File(s.createPathWithNa...
by abonsey
Thu Aug 04, 2016 1:29 pm
Forum: LEGACY scripting
Topic: using metadata in a new file
Replies: 6
Views: 17276

using metadata in a new file

I have a JDF (created via the HP JDF Control configurator) that has a dataset attached to it. I'm trying to create a simple text file for use elsewhere but I keep getting the error: Error in line 11 of script : TypeError. 'ToString' undefined or not a function Invalid XML document Below is the scrip...
by abonsey
Fri Jul 29, 2016 11:40 am
Forum: LEGACY scripting
Topic: inserting same PDF multiple times to another PDF
Replies: 4
Views: 6219

Re: inserting same PDF multiple times to another PDF

Thanks for the advice.

The insert page, whilst common throughout the document, changes depending on the input xml so it's not a fixed file. This will rule out a Pitstop action?

I am currently doing the second option of assembling the pages but I was just trying to speed things up.
by abonsey
Thu Jul 28, 2016 6:31 pm
Forum: LEGACY scripting
Topic: inserting same PDF multiple times to another PDF
Replies: 4
Views: 6219

inserting same PDF multiple times to another PDF

I've a flow that is working but looking to speed things up. At the moment an existing PDF is split to single pages and then using a Python script I add in the a new library PDF page to every split PDF. The resulting 2pp PDF then goes further into the flow where it is the merged back together with al...
by abonsey
Thu May 12, 2016 3:38 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

HI, I've been looking to improve/simplify the script by using a using search/replace via dictionary/key so that the same words are replaced throughout the whole xml. I've probably got it all wrong but here's what I've got so-far that doesn't work. Any ideas? function jobArrived( s : Switch, job : Jo...
by abonsey
Tue May 10, 2016 12:42 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

Thanks for the help. All working great now.
Onwards and Upwards from here :D

Andrew
by abonsey
Mon May 09, 2016 6:44 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

Hi,
Yes I do have the scripting module.

I start with:
function jobArrived( s : Switch, job : Job )

{
var dataset = job.getDataset("Xml");
var xml = new Document(dataset);
var Stock = xml.evalToString(/Request/Items/Item/Extrinsic[@Type='Stock']);

but it errors.... clearly it's wrong :(
by abonsey
Mon May 09, 2016 6:29 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

Hi,
Could you clarify "XML class within scripter". I've never done anything like this before.

Thanks
Andrew
by abonsey
Mon May 09, 2016 5:45 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

Here is a sample of the XML. How could I get the "Stock" information? Thanks for any help Andrew <Request type="Order" ID="2929" Date="2016-05-03T15:28:29"> <Order Version="1.0" CartNumber=“1234” Date="2016-05-03T15:28:29"> </Order> <Items>...
by abonsey
Fri May 06, 2016 1:41 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Re: Filter XML node by type then use IF THEN

Hi William,
Just PM'd you with a few questions.

Andrew
by abonsey
Thu May 05, 2016 1:06 pm
Forum: LEGACY scripting
Topic: Filter XML node by type then use IF THEN
Replies: 11
Views: 10787

Filter XML node by type then use IF THEN

I have an XML with multiple nodes that are "Extrinsic" and need to filter it to one node of Type 'X'. Once that has been filtered correctly I need to use IF THEN see what the variable is and then use a NEW variable further in the process.

Can this be done via scripting?
by abonsey
Tue Apr 12, 2016 11:49 am
Forum: LEGACY scripting
Topic: PDF page count
Replies: 2
Views: 4943

Re: PDF page count

Thanks for that. All working fine now :)
by abonsey
Mon Apr 11, 2016 12:37 pm
Forum: LEGACY scripting
Topic: PDF page count
Replies: 2
Views: 4943

PDF page count

I'm trying to get a script to run that has the total page count as a variable that I can use from an input PDF
Can anybody help with the correct expression to use to create this as a variable. I keep failing.

TIA for your help