Search found 27 matches
- Thu Apr 11, 2024 12:35 pm
- Forum: Node.js scripting
- Topic: Module Import For Script Expressions
- Replies: 1
- Views: 560
Module Import For Script Expressions
Hello, Like many others, we're looking at replacing all of our legacy Script Expressions with new, Node.JS Script Expressions. I have a question regarding Module Imports. The placeholder of new Script Expressions has the comment of // Your imports here Does this apply to only built in modules (path,...
- Mon May 15, 2023 2:31 pm
- Forum: Node.js scripting
- Topic: Unresolved Promises
- Replies: 5
- Views: 7966
Re: Unresolved Promises
Also it's worth noting that the file names won't always fit this example pattern - they could be anything.
- Mon May 15, 2023 2:26 pm
- Forum: Node.js scripting
- Topic: Unresolved Promises
- Replies: 5
- Views: 7966
Re: Unresolved Promises
Apart from the unresolved promise issue, what is missing in "Sort files in job" to accomplish what you need? Hi Freddy, I need the files to be returned using a "natural" sort. I.E if I have 10 files named File 1.pdf through File 10.pdf, I want them to be listed alphabetically an...
- Mon May 15, 2023 2:10 pm
- Forum: Node.js scripting
- Topic: Unresolved Promises
- Replies: 5
- Views: 7966
Re: Unresolved Promises
Hi Matthew,
Thank you for the quick response - that was indeed the issue.
Can't believe I missed that - definite case of snow blindness!
Thanks again,
Dan
Thank you for the quick response - that was indeed the issue.
Can't believe I missed that - definite case of snow blindness!
Thanks again,
Dan
- Mon May 15, 2023 12:32 pm
- Forum: Node.js scripting
- Topic: Unresolved Promises
- Replies: 5
- Views: 7966
Unresolved Promises
Hello, I'm trying to write a script which should sort files in a folder in a particular way. import fs from "fs"; import path from "path"; import tmp from 'tmp-promise'; function naturalSort(arr: String[]){ return arr.map(v => { let processedName = []; let str = v; for(let i = 0;...
- Tue Mar 07, 2023 5:42 pm
- Forum: Flows
- Topic: Keep job in Job Board while job is processing in external software?
- Replies: 11
- Views: 6079
Re: Keep job in Job Board while job is processing in external software?
The unique identifier isn’t stripped the issue is that the unique identifiers differs between the files that sent to Apogee with Archive hierachy and the file placed in the Generic application folder. I will try the temp file solution. I need to put it in a folder thats not the last folder in a flo...
- Fri Feb 03, 2023 3:33 pm
- Forum: Node.js scripting
- Topic: TypeScript Cannot Find Names
- Replies: 1
- Views: 6001
TypeScript Cannot Find Names
Hello, I've just tried making my first TypeScript file since having Switch Spring 2022. I used the follow SwitchScriptTool command to make the folder: "C:\Program Files\Enfocus\Enfocus Switch\SwitchScriptTool\SwitchScriptTool.exe" --create "SendOrdersToPrinter" .\ After opening m...
- Thu Sep 16, 2021 2:30 pm
- Forum: Node.js scripting
- Topic: Cannot Make New Job From Empty Folder
- Replies: 4
- Views: 9979
Re: Cannot Make New Job From Empty Folder
Hi Freddy, Apologies, my mistake for not clarifying - I am using tmp-promise which as the name would suggest is a wrapper for tmp that adds async await functionality. Another thing that this wrapper does, is change the .name variable to .path (this also caught me off guard the first time I installed...
- Thu Sep 16, 2021 11:27 am
- Forum: Node.js scripting
- Topic: Cannot Make New Job From Empty Folder
- Replies: 4
- Views: 9979
Cannot Make New Job From Empty Folder
Hello, I have a script where I am potentially producing multiple files, but want them to be contained in a single folder on output. Once I have ascertained that I will be producing multiple files, I try to create a new job based on a temporary folder as such: // If multiple files are possible, then ...
- Fri Aug 12, 2016 9:23 am
- Forum: LEGACY scripting
- Topic: SQL Injection
- Replies: 8
- Views: 13120
Re: SQL Injection
I've got an ODBC connection to the database now, if you're able to get something working that would be great! It's been added to v2 of the script here: https://github.com/open-automation/switch-sql-query Currently, it allows for 3 parameters. Just structure your SQL query with named placeholders pr...
- Thu Aug 11, 2016 9:00 am
- Forum: LEGACY scripting
- Topic: SQL Injection
- Replies: 8
- Views: 13120
Re: SQL Injection
Dominick, I'm actually using UPDATE's rather than SELECT's, is this still a viable option? Yep. But you'll need an ODBC connection to your database to use my script, so perhaps make sure that you can swing that before jumping ship on stored procedures. I've got an ODBC connection to the database no...
- Wed Aug 10, 2016 5:06 pm
- Forum: LEGACY scripting
- Topic: SQL Injection
- Replies: 8
- Views: 13120
Re: SQL Injection
Freddy, that looks like it might be the safest way to go, I'll have a look to see whether or not it's viable in my (antiquated) database setup.
Dominick, I'm actually using UPDATE's rather than SELECT's, is this still a viable option?
Dominick, I'm actually using UPDATE's rather than SELECT's, is this still a viable option?
- Wed Aug 10, 2016 11:37 am
- Forum: LEGACY scripting
- Topic: SQL Injection
- Replies: 8
- Views: 13120
SQL Injection
Hello, I was planning on using the standard database connect flow element but concluded that it probably doesn't have any sort of SQL injection prevention built in...Does Switch JavaScript have any sort of SQL injection prevention or a way to sanitize database inputs? I've gone through the manual on...
- Tue Jul 26, 2016 9:02 am
- Forum: LEGACY scripting
- Topic: Regex Ignoring New Lines
- Replies: 4
- Views: 4942
Re: Regex Ignoring New Lines
What system produces files like that? Seems like having Switch parse through a file like this reliably would be very challenging and prone to error. Tell me about it. :lol: I've no idea what the system is, I believe it's something bespoke our client had built for them by a third party, but I've bee...
- Mon Jul 25, 2016 2:38 pm
- Forum: LEGACY scripting
- Topic: Regex Ignoring New Lines
- Replies: 4
- Views: 4942
Regex Ignoring New Lines
Hi guys, I have a windows formatted text file (\r\n) that I am reading into a switch script. Here is an example of the format: =======Section A======= Value 1: I need this value Value 2: I need this value Value 3: I need this value =======Section B======= Value 4: I need all of these values Value 5:...