Search found 6 matches

by patgilmour
Fri Apr 15, 2016 4:32 pm
Forum: Scripting
Topic: Passing a Variable from Javascript to AppleScript
Replies: 1
Views: 1245

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 ...
by patgilmour
Wed Apr 13, 2016 10:44 pm
Forum: Scripting
Topic: Passing a Variable from Javascript to AppleScript
Replies: 1
Views: 1245

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...
by patgilmour
Tue Apr 05, 2016 6:52 pm
Forum: Flows
Topic: Non-Greedy Pattern Matching
Replies: 5
Views: 1892

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...
by patgilmour
Tue Apr 05, 2016 6:50 pm
Forum: Flows
Topic: Non-Greedy Pattern Matching
Replies: 5
Views: 1892

Re: Non-Greedy Pattern Matching

Thanks loicaigon - however the integer isn't at the end of a line, so it won't match.
by patgilmour
Mon Apr 04, 2016 8:44 pm
Forum: Flows
Topic: Non-Greedy Pattern Matching
Replies: 5
Views: 1892

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...
by patgilmour
Mon Apr 04, 2016 7:29 pm
Forum: Flows
Topic: Non-Greedy Pattern Matching
Replies: 5
Views: 1892

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...