Search found 327 matches

by hagchr
Mon Jul 03, 2023 8:01 am
Forum: Technical / Scripting
Topic: Accessing Array elements
Replies: 11
Views: 10019

Re: Accessing Array elements

Hello,

This works for me:

Code: Select all

CSVFileToArray>C:\Users\Christer\Desktop\msTest.txt,msArrCurrPagePath
Let>msArrCurrPageRowLast=msArrCurrPagePath_%msArrCurrPagePath_COUNT%_0
How do you define:

Code: Select all

%msArrCurrPageSize%
by hagchr
Sat Jun 10, 2023 6:54 am
Forum: Technical / Scripting
Topic: RegEx Help
Replies: 5
Views: 9294

Re: RegEx Help

Also I note the number of brackets (), that all capture information. Not a performance problem here but could be for larger data sets. For larger problems, if you need brackets but want to turn capturing off then simply change (xxxx) to (?:xxxx).
by hagchr
Sat Jun 10, 2023 6:43 am
Forum: Technical / Scripting
Topic: RegEx Help
Replies: 5
Views: 9294

Re: RegEx Help

Hi, you can eg try: let>Pattern2=(?=((%Listb%):(\d\d?)|(\d\d?):(%Listb%));(\d\d?:\d\d?);((%Lista%):(\d\d?)|(\d\d?):(%Lista%)))[^;]+;\K[^;]+ Basically what is does is start from the left and look for positions that are followed by the three pairs (where the first and third pair contain number(s) from...
by hagchr
Mon Jun 05, 2023 6:01 am
Forum: Technical / Scripting
Topic: Copy some data and store it to an Array without leaving current page
Replies: 8
Views: 10919

Re: Copy some data and store it to an Array without leaving current page

Hi, you need to use the clipboard value, eg

Code: Select all

GetClipBoard>NewValue
by hagchr
Mon May 15, 2023 7:00 pm
Forum: Beginners
Topic: String Matching
Replies: 5
Views: 6498

Re: String Matching

Hi, If --> if> MessageModel --> MessageModal Let>IGNORESPACES=1 Let>VAREXPLICIT=1 Let>str_One=A Let>str_Two=B If>str_One=str_Two MessageModal>Method One Match Else MessageModal>No match with method one EndIf Let>str_One={"A"} Let>str_Two={"B"} If>str_One=str_Two MessageModal>Match Two Match Else Mes...
by hagchr
Thu Apr 27, 2023 6:25 am
Forum: Technical / Scripting
Topic: RegEx Help
Replies: 5
Views: 9294

Re: RegEx Help

Hello, You can try: let>Pattern1=((%NumOrList%):(\d\d?);\K(\d\d?:\d\d?))|((\d\d?):(\1);(\d\d?:\d\d?)) (where \K instructs to forget what was just matched and continue.) or since right part is not used here: let>Pattern1=((%NumOrList%):(\d\d?);\K(\d\d?:\d\d?)) or to reduce further: let>Pattern1=(%Num...
by hagchr
Tue Apr 25, 2023 2:49 am
Forum: Technical / Scripting
Topic: Dialog padding/margin for labels
Replies: 7
Views: 5243

Re: Dialog padding/margin for labels

For the last one you want to change to center alignment to get the padding uniform beginning/end.
by hagchr
Thu Mar 09, 2023 4:38 pm
Forum: Technical / Scripting
Topic: Using xpath to find Nth instance of desired value
Replies: 4
Views: 2763

Re: Using xpath to find Nth instance of desired value

Hi, alternative using xPath Let>EDGEDRIVER_EXE=C:\Users\Christer\Desktop\EdgeDriver\msedgedriver.exe EdgeStart>strSessionID Let>tmpURL=file:///C:/Users/Christer/Desktop/Test.html EdgeNavigate>strSessionID,url,tmpURL // Two examples of xPath Let>strXPATH=//tr[contains(.,'Color')][2]//td[2] //Let>strX...
by hagchr
Mon Feb 13, 2023 8:23 pm
Forum: Technical / Scripting
Topic: Screen scraping values from a page
Replies: 9
Views: 5961

Re: Screen scraping values from a page

If you click on "Try the new and improved charts" and "join beta" then it seems they have added a "Table View" where you can access all the Bollinger bands per day in table format. This should make your life much easier.
by hagchr
Thu Feb 09, 2023 10:13 am
Forum: Technical / Scripting
Topic: CSVtoarray get column values
Replies: 5
Views: 2656

Re: CSVtoarray get column values

Hi, using CSVFileToArray and looking through the watch list, it seems rows starts at 1 and cols start at 0 (don't know why), ie you need to reflect that in the loop starts and stops. One example for dumping the (non-empty) items into a file: Let>source=C:\Users\Christer\Desktop\Test.csv Let>target=C...
by hagchr
Sat Oct 15, 2022 8:09 am
Forum: Technical / Scripting
Topic: Unable to click the a href
Replies: 3
Views: 4227

Re: Unable to click the a href

Hi, I think it gets confused by the "," in your xpath. You can try

Code: Select all

Let>tmp0=//*[contains(text(),'No, thanks!')]//parent::a
ChromeFindElements>session_id,xpath,tmp0,elements
ChromeElementAction>session_id,elements_1,click
by hagchr
Thu Oct 13, 2022 6:53 pm
Forum: The Water Cooler
Topic: The Unofficial Macro Scheduler Puzzler #14
Replies: 5
Views: 14084

Re: The Unofficial Macro Scheduler Puzzler #14

Hi, I agree it is not optimal if you do not know the future primes you are looking for. However, there is a way to estimate how many numbers you need in order to get n prime numbers: g(n) = nlog(n) + nlog(log(n)), where log is the natural logaritm and n the number of primes you want. It is a slight ...
by hagchr
Mon Oct 10, 2022 4:20 pm
Forum: The Water Cooler
Topic: The Unofficial Macro Scheduler Puzzler #14
Replies: 5
Views: 14084

Re: The Unofficial Macro Scheduler Puzzler #14

Hi, here is my attempt... On my machine it runs in around 6-7 min. Let's see if it matches your numbers and then interesting to see what other people come up with. The SRT at the end is just there to join the array elements into a string. Timer>start Let>max=104729 Let>ctPrimes=0 ArrayDim>Primes,ctP...
by hagchr
Fri Sep 16, 2022 6:21 pm
Forum: Technical / Scripting
Topic: JSON and UTF8 problem
Replies: 4
Views: 23467

Re: JSON and UTF8 problem

Hi, These encoding problems can be quite messy. Not sure what the best solution is, let's see if there are other comments. I tried two versions (in both cases using: WLN_ENCODING=UTF8) Use WriteLn> and - write text to new file - write text to existing file (empty txt file created in Notepad and save...
by hagchr
Fri Sep 16, 2022 10:18 am
Forum: Technical / Scripting
Topic: [Solved]Cannot access frame attributes
Replies: 5
Views: 5161

Re: Cannot access frame attributes

Hi, when I ran the script I get error code 10 for some SwitchFrames, not sure what it means. One important thing seems to be the context you are in and what is visible. For my own testing I re-wrote the script and re-started from the main page when looking for each frame, see script below. I am sure...
Sign up to our newsletter for free automation tips, tricks & discounts