Search found 659 matches

by Odlanir
07 Mar 2020, 12:37
Forum: Ask For Help
Topic: Convert Excel into Autohotkey script
Replies: 7
Views: 743

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

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

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

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...
by Odlanir
05 Mar 2020, 09:46
Forum: Ask For Help
Topic: Calculating the size of a folder
Replies: 4
Views: 236

Re: Calculating the size of a folder

Code: Select all

TotalSize := 0
Loop, Files, C:\windows\*.*, R 
    TotalSize += A_LoopFileSize
MsgBox % TotalSize 
by Odlanir
03 Mar 2020, 10:44
Forum: Ask For Help
Topic: How do I get yesterday's date?
Replies: 12
Views: 837

Re: How do I get yesterday's date?

I think you should add

Code: Select all

yday := a_now
in the #dt-1 hotstring, otherwise from the second call you get the today's date.
by Odlanir
03 Mar 2020, 09:21
Forum: Ask For Help
Topic: Starting a program - problem with blank
Replies: 1
Views: 137

Re: Starting a program - problem with blank

Code: Select all

Run, "C:\Program Files\Mozilla Firefox\FireFox.exe"  "%strPath%", ,max
by Odlanir
02 Mar 2020, 10:39
Forum: Ask For Help
Topic: watch a folder ONLY for file renaming Topic is solved
Replies: 8
Views: 588

Re: watch a folder ONLY for file renaming Topic is solved

Thanks boiler. I forgot that one, I even use it in one of my script. I'm gettin' old.
by Odlanir
01 Mar 2020, 08:54
Forum: Ask For Help
Topic: Sorting 2D Array Topic is solved
Replies: 7
Views: 642

Re: Sorting 2D Array Topic is solved

@Chunjee The sort must be in reverse order.
by Odlanir
01 Mar 2020, 08:08
Forum: Ask For Help
Topic: Reading mdb files - Microsoft Data Base Access Topic is solved
Replies: 4
Views: 907

Re: Reading mdb files - Microsoft Data Base Access Topic is solved

Because rs is the entire Recordset Object. Try this in your while loop:

Code: Select all

Msgbox % rS.Fields.Item(A_Index-1).Value
by Odlanir
25 Feb 2020, 09:05
Forum: Ask For Help
Topic: Delimiter Challenge; Loop, parse, delimiter
Replies: 2
Views: 194

Re: Delimiter Challenge; Loop, parse, delimiter

Code: Select all

delim := " - " ; a space char, a dash, and a space char again
file_name:= "Rene-Girard - Violence and Religion 2005"

arr := StrSplit(file_name, delim)
MsgBox, % "The 1rst word is " arr[1]
by Odlanir
24 Feb 2020, 12:31
Forum: Ask For Help
Topic: Add one row in Excel if cell has data Topic is solved
Replies: 3
Views: 270

Re: Add one row in Excel if cell has data Topic is solved

Code: Select all

xl := ComObjActive("Excel.Application")
row := 1
Loop, % xl.ActiveSheet.Usedrange.Rows.Count {
   if (xl.cells(row,1).value = "" ) 
      break   
   xl.ActiveSheet.Rows(++row).Insert
   ++row
}
ExitApp
by Odlanir
24 Feb 2020, 04:15
Forum: Ask For Help
Topic: Which data structure to use Topic is solved
Replies: 6
Views: 479

Re: Which data structure to use Topic is solved

Or even:

Code: Select all

arr := ["a","b","c","d","e"]
#a::send % wrd := arr.Removeat(1),arr.Push(wrd)
by Odlanir
23 Feb 2020, 04:11
Forum: Ask For Help
Topic: get files created (modified) between x & y Topic is solved
Replies: 5
Views: 357

Re: get files created (modified) between x & y Topic is solved

dir := A_ScriptDir "\Test\" timex := "180000" ; set the time to 6PM today := A_YYYY . A_MM . A_DD . timex Yesterday := today Yesterday += -1, Days Loop, files, % dir "*.png", F { if (A_LoopFileTimeModified >= today ) str .= A_Index "`t" A_LoopFileName "`t" A_LoopFileTimeModified "`tToday`n" else if...
by Odlanir
22 Feb 2020, 04:13
Forum: Ask For Help
Topic: Excel COM - Activate Worksheet by VBA Code Name?
Replies: 2
Views: 221

Re: Excel COM - Activate Worksheet by VBA Code Name?

Try this:

Code: Select all

xl := ComObjActive("Excel.Application")
xl.visible := true
xl.Sheets(CodeName("Sheet1")).Activate
ExitApp

CodeName(CodeName){
global xl
For sh in xl.Worksheets
    if ( sh.CodeName = CodeName)
	return % sh.Name
}
by Odlanir
20 Feb 2020, 09:56
Forum: Ask For Help
Topic: How to use different colors in one text line?
Replies: 4
Views: 433

Re: How to use different colors in one text line?

Or you can try to dinamically build a multicolor line, this is just a workaround: Gui,Margin,20,20 Gui,Color,859aa5 Gui,Font,s11,Courier new TextLine("Alt,,ALT-G,,Win","Black,,Black,,Black") TextLine("F1,PutFTP,DS,Dir2 TEX,Q,EXIT PC") ; with no colors passed will use the default color in the functio...
by Odlanir
16 Feb 2020, 03:22
Forum: Ask For Help
Topic: Alternative to FileSelectFolder, folder - No Gui
Replies: 2
Views: 428

Re: Alternative to FileSelectFolder, folder - No Gui

Maybe I'm wrong, but it seems that you have a script that at every run it prompt you to select a folder and this annoys you. If so, you can simply set a variable with the full path of the folder to loop through. So instead of: FileSelectFolder, folder, c:\ Loop Files, %folder%\*.txt { .... } You can...
by Odlanir
14 Feb 2020, 09:47
Forum: Ask For Help
Topic: Split an address by Street / huisnumber + ext
Replies: 2
Views: 276

Re: Split an address by Street / huisnumber + ext

Code: Select all

str := "20032372-40058767;025771;Acme;;;Acme Street 17 E;3456 AE;Chicago;NL;1;[email protected];52788"
arr := StrSplit(str, ";")
for k,v In arr {
   stro .= k = 6 ? RegExReplace(v, "(.*)\s(\d+.)","$1;$2") ";" : v ";"
}
MsgBox % RTrim(stro,";")
by Odlanir
12 Feb 2020, 09:07
Forum: Ask For Help
Topic: Gui, text controls on W10
Replies: 7
Views: 604

Re: Gui, text controls on W10

Looks like the height of the control is automatically set only when you create the control. If you change the control contents the height remainst the same as the former height. Try this: str0 := "Single line text" str1 := "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec congue neque ...

Go to advanced search