Search found 103 matches

by cstevens
Tue Mar 12, 2024 6:43 pm
Forum: LEGACY scripting
Topic: Adding multiple namespaces to xml root
Replies: 2
Views: 158

Re: Adding multiple namespaces to xml root

Yes you can. Are you reading in that XML, or generating it from scratch? It's been a while, but I believe you use createEmptyMap() function to create new namespaces, then any new elements you generate with createElement() should reference the appropriate namespace name you want to use. If you're rea...
by cstevens
Wed Jan 10, 2024 11:34 pm
Forum: Node.js scripting
Topic: NPM package for generating XML
Replies: 3
Views: 59779

Re: NPM package for generating XML

After some additional searching xmlbuilder2 https://github.com/oozcitak/xmlbuilder2 looks promising. Not sure if anyone else has any experience working with it.
by cstevens
Wed Jan 10, 2024 9:39 pm
Forum: Node.js scripting
Topic: NPM package for generating XML
Replies: 3
Views: 59779

NPM package for generating XML

Can anyone recommend an NPM package that can be used to create/modify complex XML? This is for JDF workflows, so I need to handle multiple namespaces, partitioned child elements etc. All of the libraries I can find seem to be focused primarily on XML parsing, with limited generation capabilities.
by cstevens
Thu Dec 10, 2020 11:26 pm
Forum: LEGACY scripting
Topic: Merge two text files
Replies: 2
Views: 6660

Re: Merge two text files

If you can group all the text files together beforehand (using assemble job or something) and provide a folder containing all the files to the script then it would look something like this: //Create a Directory object for the incoming folder var inFolder = new Dir(job.getPath()); //Get the list of t...
by cstevens
Wed Jun 10, 2020 10:23 pm
Forum: Node.js scripting
Topic: New scripting engine in Switch 2020
Replies: 10
Views: 25849

Re: New scripting engine in Switch 2020

Great presentation. I'm also looking forward to using this. Your description of the await operator actually cleared up a lot of confusion for me.
by cstevens
Fri May 22, 2020 5:41 pm
Forum: Applications
Topic: Variable Data and Switch
Replies: 3
Views: 7286

Re: Variable Data and Switch

You might want to look into the new PrintOS Cloud-based composer app in the app store https://www.enfocus.com/en/appstore/product/hp-printos-composer . The app handles transfer of components to/from the cloud. Since processing is done in the cloud you're not limited to a single thread with the InDes...
by cstevens
Tue Jan 14, 2020 11:39 pm
Forum: Flows
Topic: Assemble Jobs Based on Total Page Count
Replies: 5
Views: 8733

Re: Assemble Jobs Based on Total Page Count

There's probably a more elegant way to handle this with the rename element and the assemble job element using the Stats.NumberOfPages variable, but I can't figure it out. In scripting you could do something like this: //set some scope that makes sense for your application var scope = s.getElementUni...
by cstevens
Thu Dec 05, 2019 11:20 pm
Forum: LEGACY scripting
Topic: job.getPath() can't find the file
Replies: 6
Views: 10295

Re: job.getPath() can't find the file

Try entering "cmd /c " before "java ..."
by cstevens
Fri Oct 11, 2019 6:47 pm
Forum: LEGACY scripting
Topic: Javascript help
Replies: 1
Views: 5769

Re: Javascript help

I don't believe there's any support for external dependencies in Switch's scripting interface. You'll need to use the built-in HTTP Client:

https://www.enfocus.com/manuals/Develop ... class.html
by cstevens
Thu Sep 26, 2019 4:04 pm
Forum: LEGACY scripting
Topic: Add Attribute to XML, with a twist.
Replies: 12
Views: 34690

Re: Add Attribute to XML, with a twist.

Sorry, I must have accidentally unsubscribed to this thread. Sorry to leave you hanging like that. Looks like you got it working though.
by cstevens
Fri Sep 13, 2019 10:58 pm
Forum: LEGACY scripting
Topic: Add Attribute to XML, with a twist.
Replies: 12
Views: 34690

Re: Add Attribute to XML, with a twist.

So is the original XML file coming into the script? This should still be valid, you just need to change the paths to the original xml file (job.getPath()), the xml folder repository location, and the XPath where the jobnumber is located within the xml file(s) in the repository. Is the ISBN number in...
by cstevens
Fri Sep 13, 2019 9:46 pm
Forum: LEGACY scripting
Topic: Add Attribute to XML, with a twist.
Replies: 12
Views: 34690

Re: Add Attribute to XML, with a twist.

Edit. I misread your post originally, this is updated to reflect more what you wanted. Something like this maybe? I don't know what the structure of the XML file you're searching for the job number is, or which if the xml files is triggering the script. I'm assuming (probably incorrectly) that the f...
by cstevens
Thu Aug 08, 2019 10:06 pm
Forum: Flows
Topic: Switch Folder / Service Credentials
Replies: 1
Views: 5326

Switch Folder / Service Credentials

I have a Switch server that won't allow me to create user-defined folders that point to network shares (i.e. //Server Name/Share Name/Path ) on an external server. This seems to be a user access issue because it works if I point to a share that my local user account has access to. Is there a way to ...
by cstevens
Thu Jun 27, 2019 5:24 pm
Forum: Applications
Topic: HP SmartStream Designer 14.0.6 for InDesign CC 2019
Replies: 4
Views: 14824

Re: HP SmartStream Designer 14.0.6 for InDesign CC 2019

The developer told me that Designer 14.0.6 (which supports CC2019) is supported by version 140 of the Configurator (which should be the latest on the Enfocus website). If you're having issues with it working and you are using this version then check that you have Adobe "Extendscript Toolkit CC&...
by cstevens
Tue May 14, 2019 8:36 pm
Forum: Flows
Topic: HP Digital Front End JDF Control
Replies: 3
Views: 8196

Re: HP Digital Front End JDF Control

What are you trying to do? Can you show me your property settings?