Search found 13 matches
- Tue May 28, 2019 5:01 pm
- Forum: LEGACY scripting
- Topic: Dataset to XML String
- Replies: 2
- Views: 5427
Re: Dataset to XML String
A dataset IS a file, so all you need to do is read it: var datasetAsString = File.read( jData.getPath()); Thanks Freddy - that does the trick! Here's a working version for anyone who needs the same: // Load the Dataset var jobDataset = job.getDataset( "JobXML" ); // Read the dataset as st...
- Tue May 28, 2019 1:45 pm
- Forum: LEGACY scripting
- Topic: Dataset to XML String
- Replies: 2
- Views: 5427
Dataset to XML String
Hi, I have an XML dataset that I need to convert to a string (to write to a variable). I can easily access the dataset with var jData = job.getDataset("Data"); but I can find no method for converting it to a string. I assume I have to write the dataset to a temporary text file then read th...
- Thu May 02, 2019 8:28 pm
- Forum: LEGACY scripting
- Topic: Job Creation in webhookTriggered() - File Does Not Exists...
- Replies: 2
- Views: 11296
Re: Job Creation in webhookTriggered() - File Does Not Exists...
Gabriel - thanks for the reply! I did try adding the 'false' parameter as a second option, but it made no difference to the message in the Log.
I guess this is just another bug (and typo) in the Scripting module.
I guess this is just another bug (and typo) in the Scripting module.
- Thu May 02, 2019 12:25 am
- Forum: LEGACY scripting
- Topic: Job Creation in webhookTriggered() - File Does Not Exists...
- Replies: 2
- Views: 11296
Job Creation in webhookTriggered() - File Does Not Exists...
Hi, I'm creating a new job within the webhookTriggered() function. I've tried using the standard example from the docs: //create new job var job = s.createNewJob(); var f = new File(job.getPath()); f.open(File.WriteOnly); f.writeLine("Sample line."); f.close(); //single outgoing connection...
- Mon Nov 20, 2017 8:20 pm
- Forum: LEGACY scripting
- Topic: Usage of encodeURI
- Replies: 3
- Views: 5950
Re: Usage of encodeURI
@Padawan - yes, it must be that. Of course, it's not me using %20 in the script, it is Enfocus Switch ;-) I guess I'll have to set up an http request and see if the URI is, in fact, correctly encoded. Thanks for posting the info. ===UPDATE=== Just to confirm, the %2 is reserved by Switch so if you e...
- Fri Nov 17, 2017 6:24 pm
- Forum: LEGACY scripting
- Topic: Usage of encodeURI
- Replies: 3
- Views: 5950
Re: Usage of encodeURI
Could this be because Enfocus Switch Scripter has reserved '%20' for its own special usage?
- Fri Nov 17, 2017 6:14 pm
- Forum: LEGACY scripting
- Topic: Usage of encodeURI
- Replies: 3
- Views: 5950
Usage of encodeURI
Hi, Does anyone have a simple working example of how to use the HTTP class's encodeURI(theURL) method? For example, this doesn't work: // Build param var theParam = "this is a test"; // Encode Param var theParamEncoded = encodeURI(theParam); // Build URL var theURL = "http://www.examp...
- Fri Apr 15, 2016 4:32 pm
- Forum: LEGACY scripting
- Topic: Passing a Variable from Javascript to AppleScript
- Replies: 1
- Views: 3956
Re: Passing a Variable from Javascript to AppleScript
Quick answer to my own question: you can read private data in Applescript with the following: set varNewForAppleScript to evaluate variable as string of j variable "[Job.PrivateData:Key=\"varForAppleScript\"]" The [Job.PrivateData:Key...] part is the standard tag that is created ...
- Wed Apr 13, 2016 10:44 pm
- Forum: LEGACY scripting
- Topic: Passing a Variable from Javascript to AppleScript
- Replies: 1
- Views: 3956
Passing a Variable from Javascript to AppleScript
Hi, I have a flow where I use a script (Javascript) to pull some variables from some job metadata. I then want to pass these variables to an AppleScript so that I can do some AppleScript commands. Is the best way to do this to have two script elements, as in: - Use Scripting Element 1 (Javascript) t...
- Tue Apr 05, 2016 6:52 pm
- Forum: Flows
- Topic: Non-Greedy Pattern Matching
- Replies: 5
- Views: 6226
Re: Non-Greedy Pattern Matching
We found a solution. In the end, we went with a Script and used this pattern to match the required string: var regExEmailBody = /(Order No)(.*)(\/span\>)([\d]{3,6})(.*)(Sequential\sID)/; The trick was to find something consistent *after* the required string, and we had "(Sequential ID)" to...
- Tue Apr 05, 2016 6:50 pm
- Forum: Flows
- Topic: Non-Greedy Pattern Matching
- Replies: 5
- Views: 6226
Re: Non-Greedy Pattern Matching
Thanks loicaigon - however the integer isn't at the end of a line, so it won't match.
- Mon Apr 04, 2016 8:44 pm
- Forum: Flows
- Topic: Non-Greedy Pattern Matching
- Replies: 5
- Views: 6226
Re: Non-Greedy Pattern Matching
Thanks for the reply. I have been trying to do this in a variable builder within a flow. It examines a 'body' node from an 'Email' metadata set. An example of the string it would try for the pattern match within: Order No</span></b><span style="font-size: 9pt;" class=""><span cla...
- Mon Apr 04, 2016 7:29 pm
- Forum: Flows
- Topic: Non-Greedy Pattern Matching
- Replies: 5
- Views: 6226
Non-Greedy Pattern Matching
I'm trying to do a non-greedy pattern match using Regex to get a 3-6 digit order number. The standard PCRE Search Pattern is:(Order No)(.*?)(\d{3,6}) Then I get the order number using $3 (or \3 for Switch) The problem is .*? in Switch is greedy and so it grabs everything to the end of the file/strin...