Search found 635 matches

by Odlanir
26 Mar 2020, 06:49
Forum: Ask For Help
Topic: Create an array from a CSV-file Topic is solved
Replies: 9
Views: 287

Re: Create an array from a CSV-file Topic is solved

Is it possible to replace FieldNames.Push(A_LoopField) with Array[Key] := Value to allow other than numbers in the first column? What you mean ? In the first col you can have everything: str= ( "KeyField","HeadTwo","HeadThree","HeadFour","LastHeader" ; Header "AAAAA","user info","0","20191001",99 "...
by Odlanir
26 Mar 2020, 04:50
Forum: Ask For Help
Topic: Create an array from a CSV-file Topic is solved
Replies: 9
Views: 287

Re: Create an array from a CSV-file Topic is solved

You can also build an Object dinamically ( without hardcoding the field names ) The only drawback is that the key ( first field ) must be univocal. str= ( "UserNumber","HeadTwo","HeadThree","HeadFour" ; Header "100","user info","0","20191001" "318","Some Text","1","" "905","Why Not","1","" ) UserArr...
by Odlanir
21 Mar 2020, 13:29
Forum: Ask For Help
Topic: Script For Closing an App Window During a Period of Time
Replies: 3
Views: 105

Re: Script For Closing an App Window During a Period of Time

Code: Select all

if A_Hour between 0 and 20  ; true from 00:00:01 and 20:59:59
by Odlanir
21 Mar 2020, 06:52
Forum: Ask For Help
Topic: Is the solution - object / class or .. information from an ini-file Topic is solved
Replies: 6
Views: 356

Re: Is the solution - object / class or .. information from an ini-file Topic is solved

My desire has been changed (a little) I wonder if, or how is it possible to make an object with a new level like this .: An ini file is similar to an object (as I see it) filename (= name of the object) Section Key Value Some like this? fname := "test99.ini" ; I saved this file using your Inifile d...
by Odlanir
21 Mar 2020, 05:05
Forum: Ask For Help
Topic: RegExMatch() help with script
Replies: 1
Views: 74

Re: RegExMatch() help with script

A possible way: Clipboard = ( Yo Jugar Las cinco de la tarde Capir, Andaron en la calle Andar en la calle Buenasdias a todos [Mi madre y yo Comer] No se cuando tengo que venir Lo que quiero decir no es claro Esta es la ultima línea de ejemplo ) arr := [] ; array to save the matching words for k, v i...
by Odlanir
19 Mar 2020, 04:22
Forum: Ask For Help
Topic: How to allow 0-9, A-Ö and a-ö Topic is solved
Replies: 7
Views: 307

Re: How to allow 0-9, A-Ö and a-ö Topic is solved

Your Result assignment will NEVER be "NOT OK!".
Try this:

Code: Select all

Result := RegExMatch(aInput[A_Index], "i)^[0-9A-ZÅÄÖåäö\s]+$") ? "OK!" : "NOT OK!"
by Odlanir
17 Mar 2020, 10:51
Forum: Ask For Help
Topic: Future date from past, is it possible?
Replies: 14
Views: 399

Re: Future date from past, is it possible?

Another way:

Code: Select all

Past := "02.03.2020"
date := format("{3:}{2:}{1}",StrSplit(past,".")*)
Date += 14, D
FormatTime, Clipboard, % Date, dd.MM.yyyy
by Odlanir
16 Mar 2020, 04:47
Forum: Ask For Help
Topic: Help with something so simple - Random Sleep with a Loop
Replies: 5
Views: 195

Re: Help with something so simple - Random Sleep with a Loop

Code: Select all

#Persistent
SetTimer, PressTheKey, -10000
maxiteration := 10, cnt := 0
Return

PressTheKey:
SetTimer, PressTheKey, Off
if (++cnt > maxiteration )
   ExitApp
Send, {Click}
Random, rnd, 10000, 30000
SetTimer, PressTheKey, -%rnd%
Return
by Odlanir
15 Mar 2020, 11:40
Forum: Ask For Help
Topic: GUI ComboBox - Activate a selection at start Topic is solved
Replies: 2
Views: 119

Re: GUI ComboBox - Activate a selection at start Topic is solved

SelectVal := "123|456||789" Gui 1: Font, s16 Normal, Arial Gui 1: Add, ComboBox, w90 h150 vChoice gCheckChoice, %SelectVal% Gui 1: Font, cPurple s16 Bold, Arial Gui 1: Add, Text, xp+100 yp+2 w130 h20 vChoiceText -hidden ; Gui 1: Add, Button, xm y+30 gValueCheck, OK! ; Gui +alwaysOntop Gui 1: Show, ...
by Odlanir
15 Mar 2020, 06:47
Forum: Ask For Help
Topic: Future dates in months and years?
Replies: 5
Views: 302

Re: Future dates in months and years?

1) Future date is in two months but always the first day of that month.: mm := A_MM, yy := SubStr(A_YYYY,3) deltaMonth := 2 mm := mm + deltaMonth > 12 ? (mm + deltaMonth-12, yy+=1) : (mm +deltaMonth) send, % format("{}.{:02}.{}","01",mm,yy) "`n" 2) 10 years exact date from today send % format("{}.{...
by Odlanir
15 Mar 2020, 04:37
Forum: Ask For Help
Topic: Help with something so simple - Random Sleep with a Loop
Replies: 5
Views: 195

Re: Help with something so simple - Random Sleep with a Loop

Try this:

Code: Select all

#Persistent
SetTimer, PressTheKey, -10000
Return

PressTheKey:
SetTimer, PressTheKey, Off
Send, {Click}
Random, rnd, 10000, 30000
SetTimer, PressTheKey, -%rnd%
Return
by Odlanir
14 Mar 2020, 04:45
Forum: Ask For Help
Topic: Phone numbers or text in a variable Topic is solved
Replies: 8
Views: 304

Re: Phone numbers or text in a variable Topic is solved

Albireo wrote:
14 Mar 2020, 04:21
Nop! (it doesn't work)
Input = 0701234567 - the result should be .: 0046701234567... (not 004070...)
....
Sure?
Using my regex the result with your input IS 0046701234567 .
by Odlanir
14 Mar 2020, 04:07
Forum: Ask For Help
Topic: Phone numbers or text in a variable Topic is solved
Replies: 8
Views: 304

Re: Phone numbers or text in a variable Topic is solved

Replace the boiler RegexMatch with this: if RegExMatch(Input, "^\D*0(\d{7,9})\D*$", Match) PhoneNo := "0046" . Match1 RegexMatch docs says OutputVar Mode 1 (default): Specify a variable in which to store the part of Haystack that matched the entire pattern. If the pattern is not found (that is, if t...
by Odlanir
11 Mar 2020, 11:07
Forum: Ask For Help
Topic: Send text containing last month and correct year
Replies: 6
Views: 348

Re: Send text containing last month and correct year

Forget the format.
Delete ALL the signature := lines and put instead this single line:

Code: Select all

signature := SubStr(A_ThisHotkey, -1))
by Odlanir
11 Mar 2020, 07:23
Forum: Ask For Help
Topic: Maximum length of any variable from several arrays and maximum variables from any array Topic is solved
Replies: 3
Views: 144

Re: Maximum length of any variable from several arrays and maximum variables from any array Topic is solved

Some like this? Array := {} Array[1] := ["123", "123", "12", "1"] Array[2] := ["1", "2", "1234567890"] Array[3] := ["2", "3"] Array[4] := [1,2,3,4,5,6,7,8,9] maxArrLen := maxStrLen := 0 for k,v in Array { maxArrLen := Max(maxArrLen, v.length()) for k1, v1 in v { maxStrLen := Max(maxStrLen, StrLen(v1...
by Odlanir
08 Mar 2020, 05:02
Forum: Ask For Help
Topic: Send text containing last month and correct year
Replies: 6
Views: 348

Re: Send text containing last month and correct year

First, if you empty the clipboard at the end of every hotstring you can avoid to save its contents so you can delete the Clipsave := Clipboard assignment. Second, you can shorten the all script this way: ::SAGB:: ::SALN:: ::SAEM:: ::SAKN:: ::SALS:: signature := Format("{:U}",SubStr(A_ThisHotkey, -1)...
by Odlanir
07 Mar 2020, 12:37
Forum: Ask For Help
Topic: Convert Excel into Autohotkey script
Replies: 7
Views: 397

Re: Convert Excel into Autohotkey script

... How can I go about achieving this, specifically the "logic/calculation" part? .. This is a possible calculation part. Time is expressed in european format: time := "08:24:00" ; time must be in format HH:mm:ss Loop { time := Seconds2Time(Time2Seconds(time)+360) str .= time "`n" }until ( 86040 < ...
by Odlanir
07 Mar 2020, 06:51
Forum: Ask For Help
Topic: Send text containing last month and correct year
Replies: 6
Views: 348

Re: Send text containing last month and correct year

The var date will hold the date in format yyyyMMdd, the var dat will hold the format MMMM yyyy Clipsave := Clipboard date := (A_MM-1 = 0 ? (A_YYYY-1) "1201" : A_YYYY Format("{:02}",A_MM-1) "01" ) FormatTime, dat, %date%, MMMM yyyy Clipboard = ( Please find statement attached showing all invoices owi...
by Odlanir
06 Mar 2020, 10:38
Forum: Ask For Help
Topic: Need help creating a script to show the contents of the five newest files in a folder
Replies: 3
Views: 153

Re: Need help creating a script to show the contents of the five newest files in a folder

Seems like your csv files ends up with a line with only an extra carriage return.
If so you can avoid adding the newline in the FileAppend:

Code: Select all

Last5FilesContents .= Allfile "`n" ; replace this ....
;
Last5FilesContents .= Allfile ; ... with this
by Odlanir
06 Mar 2020, 09:43
Forum: Ask For Help
Topic: Need help creating a script to show the contents of the five newest files in a folder
Replies: 3
Views: 153

Re: Need help creating a script to show the contents of the five newest files in a folder

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #Persistent SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance force Newest := 0 NewestFile := "" Gui, +AlwaysOnTop Gui, font, S10 Arial Bold Gui, add, edit, w500 r20 vLast5 G...

Go to advanced search