Search found 274 matches

by hagchr
Fri Jan 24, 2020 1:27 pm
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 380

Re: Remove blank lines when there are more than one of them

Sometimes I get differences using MS and RegexBuddy, but usually it relates to difference in modifier settings. Top left in RegexBuddy you have different choices for eg, case sensitivity, spacing, dot matches line breaks, etc. In MS, if unsure, it can help to include the modifier in the search patte...
by hagchr
Fri Jan 24, 2020 12:52 pm
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 380

Re: Remove blank lines when there are more than one of them

From the the Manual:
RegEx is compatible with the Perl 5.10 regular expression syntax using the PCRE library.
by hagchr
Wed Jan 22, 2020 8:40 pm
Forum: Beginners
Topic: Cosine function
Replies: 2
Views: 120

Re: Cosine function

Hi, According to the manual, the COS function requires the angle to be entered in radians, not degrees, see conversion below:

Code: Select all

Let>val_in_degrees=340
Let>val_in_radians={%val_in_degrees%/360*2*Pi}
Let>result={cos(%val_in_radians%)}
MDL>result
by hagchr
Wed Jan 22, 2020 9:48 am
Forum: Technical / Scripting
Topic: Remove blank lines when there are more than one of them
Replies: 10
Views: 380

Re: Remove blank lines when there are more than one of them

Hi, just an example how to solve it using Regex> You treat the text as one line and look for two or more consecutive end-of-line-characters (\R in regex language). If found replace with just two of them - %CRLF%. LabelToVar>Text,strText Let>tmp0=(?s)(\R){2,} RegEx>tmp0,strText,0,m,nm,1,%CRLF%%CRLF%,...
by hagchr
Wed Jan 08, 2020 12:09 pm
Forum: Technical / Scripting
Topic: Read checkbox from ini
Replies: 1
Views: 135

Re: Read checkbox from ini

Hi, Not sure of the State property right now but if you just use SetDialogProperty> to set the Checked property to True/False, and then show the Dialog, it should work. Dialog>Dialog1 object Dialog1: TForm Left = 361 Top = 284 HelpContext = 5000 BorderIcons = [biSystemMenu] ClientHeight = 203 Client...
by hagchr
Sun Nov 24, 2019 7:32 pm
Forum: Technical / Scripting
Topic: RegEx Help
Replies: 4
Views: 428

Re: RegEx Help

Hello, I have read that MS uses a version (not the latest) of Perl but am not sure about the details. To get blocks incl tokens you can eg use: (?s)/\*.+?\*/ To get blocks w/o tokens you can eg use: /\*\R\K(?s).+?(?=\R\*/) where (?s) turns on single line mode \R matches end of lines \K discards what...
by hagchr
Mon Jul 08, 2019 7:13 pm
Forum: Technical / Scripting
Topic: Return Value Given Code
Replies: 3
Views: 341

Re: Return Value Given Code

I feared one of those mega sheets with a lots of data which would have "clogged" any array. But if your excel sheet is simple with just the table and not too many rows then I think your solution is better.
by hagchr
Mon Jul 08, 2019 6:05 pm
Forum: Technical / Scripting
Topic: Return Value Given Code
Replies: 3
Views: 341

Re: Return Value Given Code

Hi, There are many ways to solve this, see one example below. Using VBS, the excel file is opened and the range containing the company data is copied to the clipboard and assigned to a variable. Then, based on the company id in question, the name is looked up. To use the example, you just need to ch...
by hagchr
Wed May 15, 2019 12:33 pm
Forum: General Discussion
Topic: Position of spaces
Replies: 14
Views: 5204

Re: Position of spaces

I think you need to specify that you want the second regex to be case sensitive (ie A and a are not the same). You do that by adding the modifier (?-i) to the beginning of the pattern, ie change to Let>pattern=(?-i)[^a-z ] (?-i really means turn off case insensitivity) You can also search for all th...
by hagchr
Sat Apr 27, 2019 8:12 am
Forum: Technical / Scripting
Topic: Excel Trouble
Replies: 12
Views: 1386

Re: Excel Trouble

It seems to work if the file was openend using XLOpen>, so that may be the requirement. This works for me:

Code: Select all

XLOpen>C:\Users\Christer\Desktop\CHTestGET.xlsx,1,xlBook0
XLGet>C:\Users\Christer\Desktop\CHTestGET.xlsx,xlBook
XLGetCell>xlBook,Sheet1,1,1,strCell
MDL>strCell
by hagchr
Mon Dec 03, 2018 3:57 pm
Forum: Technical / Scripting
Topic: Mousemove+Animation>ImagePos Help
Replies: 5
Views: 899

Re: Mousemove+Animation>ImagePos Help

XArr is the name of an array which contains (possible) multiple values. These values are then referred to by using XArr_0, XArr_1, XArr_2, ... etc. depending on what findimagepos> finds. So in findimagepos> you use XArr and YArr. When you want to refer to the results in other places/comparisons you ...
by hagchr
Mon Dec 03, 2018 8:17 am
Forum: Technical / Scripting
Topic: Mousemove+Animation>ImagePos Help
Replies: 5
Views: 899

Re: Mousemove+Animation>ImagePos Help

Hi, one thing that stands out is that your XArr and YArr resulting from FindImagePos> are really arrays and you also need to use an index, eg XArr_0 for the first match. So try %XArr_0% and %YArr_0% instead of %XArr% and %YArr%.
by hagchr
Mon Nov 05, 2018 10:42 am
Forum: Technical / Scripting
Topic: Select an item in ListBox
Replies: 7
Views: 944

Re: Select an item in ListBox

Hi, this works for me, maybe I misunderstood the question. Dialog>Dialog1 object Dialog1: TForm Left = 247 Top = 97 HelpContext = 5000 BorderIcons = [biSystemMenu] Caption = 'CustomDialog' ClientHeight = 211 ClientWidth = 476 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText...
by hagchr
Mon Nov 05, 2018 8:43 am
Forum: Technical / Scripting
Topic: Select an item in ListBox
Replies: 7
Views: 944

Re: Select an item in ListBox

Have you tried using:

Code: Select all

SetDialogProperty>Dialog1,MSListBox1,SelectedIndex,0
with the last item (here 0) picking item to be selected, 0 for the first item, 1 for the second aso.
by hagchr
Thu Sep 20, 2018 9:45 am
Forum: Enhancement Suggestions
Topic: Open in New Tab...
Replies: 0
Views: 3576

Open in New Tab...

When opening a file using "Open in New Tab..." it would be convenient to have the selection browser start already at your ms script folder (now you have to click your way from eg the desktop to locate first the script folder and then the script)... or is there a setting I have missed?
Sign up to our newsletter for free automation tips, tricks & discounts