Search found 100 matches

by cstevens
Thu Dec 10, 2020 11:26 pm
Forum: LEGACY scripting
Topic: Merge two text files
Replies: 2
Views: 1401

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: 4184

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: 1877

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: 2769

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: 3811

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: 1602

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: 6621

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: 6621

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: 6621

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: 1652

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: 6313

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" inst...
by cstevens
Tue May 14, 2019 8:36 pm
Forum: Flows
Topic: HP Digital Front End JDF Control
Replies: 3
Views: 2501

Re: HP Digital Front End JDF Control

What are you trying to do? Can you show me your property settings?
by cstevens
Tue May 14, 2019 1:01 am
Forum: Flows
Topic: HP Digital Front End JDF Control
Replies: 3
Views: 2501

Re: HP Digital Front End JDF Control

What type of press are you driving through JDF?
What settings do you have in the configurator and what are you hoping to have happen?
by cstevens
Mon May 06, 2019 4:56 pm
Forum: LEGACY scripting
Topic: script get oldest file from directory
Replies: 2
Views: 2385

Re: script get oldest file from directory

I normally do an entryList on a Dir object for something like this: function timerFired( s : Switch ) { var inFolder = new Dir("C:/Shared"); var fileList = inFolder.entryList("*.pdf", Dir.Files, Dir.Time|Dir.Reversed); s.log(1, "Oldest file in folder is: " + fileList[0]); var job = s.createNewJob();...
by cstevens
Tue Apr 23, 2019 5:11 pm
Forum: LEGACY scripting
Topic: RegEx replace in Script expression
Replies: 4
Views: 3487

Re: RegEx replace in Script expression

you can also use the String.split('_') and Array.join('_') methods to convert these strings into an array and then modify the 3rd instance of the array: var inString = "a1b2c3_DDYYKK_123_ABC_X1Y1Z1"; var strArray = inString.split('_'); strArray[2] = "456"; inString = strArray.join("_"); s.log(1, "Mo...