Search found 317 matches

by hagchr
Sat Oct 15, 2022 8:09 am
Forum: Technical / Scripting
Topic: Unable to click the a href
Replies: 3
Views: 1677

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: 3560

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: 3560

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: 3
Views: 1316

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: 1657

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...
by hagchr
Tue Aug 30, 2022 8:31 am
Forum: Technical / Scripting
Topic: Macro cuts off char
Replies: 8
Views: 2003

Re: Macro cuts off char

Hi! Looks strange... You could try to send the text to Notepad to check if that gives the same result. Also make sure the variables are defined correctly. For example, the first (incorrect) version below would give the (first) problem you encounter:

Let>%BWID%=123456
Let>BWID=123456
by hagchr
Tue Aug 02, 2022 9:37 am
Forum: Scripts and Tips
Topic: Rearrange array elements (random order)
Replies: 0
Views: 3320

Rearrange array elements (random order)

A simple algorithm for rearranging array elements in random order. The bottom part is just to convert the array back to a string to show it in an MDL>. Maybe ArrayRand> could be considered for future updates? // Script to rearrange array elements in a random order. // Let>str=1,2,3,4,5,6,7,8,9,10,11...
by hagchr
Thu Jul 14, 2022 6:18 am
Forum: Technical / Scripting
Topic: Converting Text to Numeric
Replies: 12
Views: 8105

Re: Converting Text to Numeric

Sorry, I thought you were just looking for one digit. Simply change from \d (one digit) to \d+ (one or more digits) and you should catch all.
by hagchr
Tue Jul 12, 2022 1:01 pm
Forum: Technical / Scripting
Topic: GetWindowHandle Timeout?
Replies: 10
Views: 2950

Re: GetWindowHandle Timeout?

I added the process ID and process name (...exe etc) to the output. One more dimension but maybe still an issue if your project name keeps changing. Let>WIN_USEHANDLE=1 GetActiveWindow>strTitle,nXPos,nYPos,, GetWindowParent>strTitle,1,hWnd GetWindowChildList>hWnd,child_list Let>res= //all handles ->...
by hagchr
Tue Jul 12, 2022 10:37 am
Forum: Technical / Scripting
Topic: GetWindowHandle Timeout?
Replies: 10
Views: 2950

Re: GetWindowHandle Timeout?

Hi! I played around with trying to find window handles and your solution with GetWindowList> seems to work fine with easy top level windows. Tried to change WF_TYPE to see if it is possible to to get all (visible, child ...) windows but no change in result. Then I tried to get the parent of the curr...
by hagchr
Tue Jul 12, 2022 6:45 am
Forum: Technical / Scripting
Topic: Converting Text to Numeric
Replies: 12
Views: 8105

Re: Converting Text to Numeric

Small tip. If you are just looking for the digit/number you can search for that directly eg:

Code: Select all

regex>\d,myStr,0,matches,num,0
\d will look for a digit, and your number will be in matches_1.
by hagchr
Fri Jul 08, 2022 9:35 pm
Forum: Technical / Scripting
Topic: Window Handles and Finding Windows...
Replies: 2
Views: 1764

Re: Window Handles and Finding Windows...

Hi, your RegEx patterns will look search the whole string. If you want the string to start with the pattern then you need to anchor it with a ^ (start of string), ie Let>cubpat=^Cubase .+ Let>nuepat=^Nuendo .+ (Look for a start of string character (^) followed by Cubase / Nuendo etc). If the names s...
by hagchr
Thu Jul 07, 2022 6:53 pm
Forum: Technical / Scripting
Topic: Any way to get which item has been clicked in a dialog?
Replies: 8
Views: 2373

Re: Any way to get which item has been clicked in a dialog?

Hi, Great that you have sorted it out. Some more thoughts: For "loading" the the entire ini file you could also read it as a normal file, into a variable, remove the [KEYS] row and simply add Let> at the beginning of each row using RegEx>. Then by using IncludefromVar> all ini-variables will be upda...
by hagchr
Sun Jul 03, 2022 12:36 pm
Forum: Technical / Scripting
Topic: Any way to get which item has been clicked in a dialog?
Replies: 8
Views: 2373

Re: Any way to get which item has been clicked in a dialog?

Hi, I don't know if you can remove dialoghandlers by passing a parameter, but you can pass a parameter in the SRT call. Not sure if it helps... Dialog>Dialog1 object Dialog1: TForm Left = 266 Top = 104 HelpContext = 5000 BorderIcons = [biSystemMenu] Caption = 'CustomDialog' ClientHeight = 389 Client...
by hagchr
Tue May 31, 2022 5:12 pm
Forum: Technical / Scripting
Topic: Help with JSONPARSE
Replies: 4
Views: 2271

Re: Help with JSONPARSE

alternative: HTTPRequest>https://1ml.com/channel?json=true,,GET,,sJSON JSONParse>sJSON,$..channel_id,ChannelID JSONParse>sJSON,$..fee_base_msat,feebase JSONParse>sJSON,$..fee_rate_milli_msat,feerate I note you have more than one feebase/feerate per channel so depends how you want to parse it out. Eg...
Sign up to our newsletter for free automation tips, tricks & discounts