Search found 99 matches

by bkromer
Thu Dec 09, 2021 5:33 pm
Forum: Node.js scripting
Topic: stdout as opaque dataset, how does it work?
Replies: 5
Views: 5042

stdout as opaque dataset, how does it work?

With the new version of Switch it's possible to run an executable with "Execute command" and have the stdout written to the file as opaque dataset. This is documented here: https://www.enfocus.com/manuals/UserGuide/SW/21.1/home.html#en-us/common/sw/reference/r_execute_command.html I would ...
by bkromer
Thu Dec 09, 2021 5:12 pm
Forum: Node.js scripting
Topic: Cannot find module
Replies: 2
Views: 2082

Re: Cannot find module

Deactivating the Icon didn't work. I wrote another script with the "axios" package and "form-data" and this one worked perfectly so I'm guessing "libxmljs2-xsd" doesn't run on the version of nodeJS installed with switch. There is really no good package to validate XML a...
by bkromer
Mon Dec 06, 2021 3:14 pm
Forum: Node.js scripting
Topic: Cannot find module
Replies: 2
Views: 2082

Cannot find module

Hey there, this is my first SwitchScript with Node.js envolved. I want to use a third party package from npm that can validate XML against a XSD. I picked this one https://www.npmjs.com/package/libxmljs2-xsd. My code: const xsd = require('libxmljs2-xsd'); const fs = require('fs'); async function job...
by bkromer
Mon Dec 06, 2021 12:53 pm
Forum: Switch
Topic: WebHooks / HTTP Listener dosn't work after Switch 21 Update
Replies: 2
Views: 2298

Re: WebHooks / HTTP Listener dosn't work after Switch 21 Update

Thanks for the support. I deactivated HTTP and HTTPS WebHooks in the settings which forces Switch to restart. Then I activated it again (restart again) and then it worked. I restarted Switch and the Server itself multiple times but this didn't solve the problem. Now everything workes fine and I'am g...
by bkromer
Fri Dec 03, 2021 8:57 pm
Forum: Switch
Topic: WebHooks / HTTP Listener dosn't work after Switch 21 Update
Replies: 2
Views: 2298

WebHooks / HTTP Listener dosn't work after Switch 21 Update

Hi there, we just updated Switch to the latest Version 21. So far everything went fine. All Flows are up and running. :!: But our WebHooks seem not to work anymore. Also the SwitchHttpListener.exe shows up in task manager from time to time but keeps disappearing afterwards. I noticed that in the set...
by bkromer
Thu Oct 07, 2021 1:48 pm
Forum: LEGACY scripting
Topic: Write PDF from base64-String
Replies: 1
Views: 5787

Re: Write PDF from base64-String

Okay that was dumb I just found the solution... I need to use "fromBase64" instead of "utf-8".

Code: Select all

var ba = new ByteArray( base64Label, "fromBase64");
by bkromer
Thu Oct 07, 2021 1:44 pm
Forum: LEGACY scripting
Topic: Write PDF from base64-String
Replies: 1
Views: 5787

Write PDF from base64-String

I get a PDF as bases64 and just need to write a pdf from that. How can I make this in a Legacy Script? My code so far: function jobArrived( s : Switch, job : Job ) { const base64Label = "JVBERi0xLjQKJeLjz9MKMyAwIG9i............"; const path = job.createPathWithName("DPDLabel.pdf"...
by bkromer
Tue Jul 27, 2021 8:41 am
Forum: LEGACY scripting
Topic: How to parse XML Response from Chili Publish API in Switch Legacy Scripter
Replies: 2
Views: 5940

Re: How to parse XML Response from Chili Publish API in Switch Legacy Scripter

I tried this with the Chili Publish Flow Element and action documentCreatePDF. ATM it's not working. Chili Support works on this ticket. We haven't updated switch. Because it's risky and we ain't got the time and capacity to fix everything of those old flows. Thanks Freddy.👍🏻 I will use a Nodejs ser...
by bkromer
Mon Jul 26, 2021 8:11 pm
Forum: LEGACY scripting
Topic: How to parse XML Response from Chili Publish API in Switch Legacy Scripter
Replies: 2
Views: 5940

How to parse XML Response from Chili Publish API in Switch Legacy Scripter

Hey folks, how can I parse the XML from a "theHTTP.getServerResponse()"-string. Looks like this. So need to enter the "key" element. "<apiKey succeeded="true" key="MYNEWAPIKEY" validTill="2021-07-27 03:56:15Z" superAdmin="false" />&quo...
by bkromer
Tue May 04, 2021 11:00 pm
Forum: LEGACY scripting
Topic: How to POST a file to an API (Content-Type: multipart/formdata)
Replies: 9
Views: 21019

Re: How to POST a file to an API (Content-Type: multipart/formdata)

Cant find a Documentation for that API. Can you provide some more information on Müller Martini Connex?
rgpepper wrote: Tue May 04, 2021 7:23 pm ...I need to do this without scripting....
Why :?:
by bkromer
Thu Apr 22, 2021 7:42 am
Forum: LEGACY scripting
Topic: Get E-Mails as .eml?
Replies: 1
Views: 2685

Get E-Mails as .eml?

Is it possible to write a Script to connect to a pop3 and get new mails and save it as ".eml"?
by bkromer
Thu Apr 22, 2021 7:34 am
Forum: Switch
Topic: Receive E-Mails as ".eml" possible?
Replies: 1
Views: 2566

Receive E-Mails as ".eml" possible?

Hi there,

as far as I know when using the incoming E-Mail Node we receive a Folder with a txt or when specified the attachments

Is it somehow possible to receive the E-Mail itself as ".eml"?

Thanks in Advance for any hint.
by bkromer
Thu Dec 10, 2020 3:15 pm
Forum: LEGACY scripting
Topic: Merge two text files
Replies: 2
Views: 6701

Merge two text files

Hello, I need to run a OCR on PDF Files. I want to use Tesseract. Tesseract need pictures so I build a Flow to convert PDF to JPEG and read them with OCR. Tesseract spits out txt files. I then want to read in those text Files in my script and use RegEx to sort them by specific identifiers and finall...
by bkromer
Fri Nov 20, 2020 10:59 am
Forum: LEGACY scripting
Topic: Select a file from the beginning of a flow
Replies: 20
Views: 20662

Re: Select a file from the beginning of a flow

Okay this worked for me now: var dataset = job.getDataset( "OpaqueJson" ); var jsonFilePath = dataset.getPath(); var jsonFileObj = File.read( jsonFilePath ,'utf-8'); var orderJson = JSON.parse( jsonFileObj ); Bildschirmfoto 2020-11-20 um 10.57.01.png Bildschirmfoto 2020-11-20 um 10.57.22.p...
by bkromer
Fri Nov 20, 2020 10:25 am
Forum: LEGACY scripting
Topic: DPD SOAP API
Replies: 10
Views: 14271

Re: DPD SOAP API

We've been integrating with DPD as well (Portugal), and it will be different, but maybe some of this can be helpful. DPD Portugal still doesn't have a REST API, as far as I know, so we've been using SOAP as well. We ended up using a script (still legacy) to build the XML file, according to the docu...