Applies to:

  • Microsoft Windows 7 Enterprise
  • AutoHotkey (see code for AHK version)

What?
Someone suggested an app that counts the days I have left serving my notice. I thought I'd go one better and have it calculate to the nearest second. I call this latest app "byeBU" and this is version 0.4 Beta (unofficial app).

Why?
Something to do...

How?

What?
So this is an article to list methods of retrieving the number of files in a folder/directory.

Why?
Why can't we just use a loop and file pattern native to the Autohotkey programming language:

  1.  UserFolder:="C:" 
  2.  -- UserFolder := RegExReplace( MyInputField, "\\$")  ; gets rid of trailing slash if required 
  3.   
  4.  -- Method #1 
  5.  count := 0 
  6.  Loop, %UserFolder%\*.*, 0, 1  
  7.    count++ 
  8.   
  9.  -- note for future use: 
  10.  ; if A_LoopFileAttrib contains H,R,S 
  11.  ;    continue 
This works fine at home on your local host on a local drive. Try using this over a networked drive and more time will be spent counting the files then the actual processing (or whatever your script is trying to do).

What?
A quick article on if you were given a webpage coded in HTML, what methods in AutoHotkey could you use to separate out the HTML Tables into a ListView.

Why?
I want a snippet of code that replicates any HTML table.

How?
I've been trying various ways so I'm posting them here. My opinions on them change with the weather so until I do some benchmarking I won't know which ones best:

Just a quick note as I use this function in various scripts. This adds the 1000th separator comma:

  1.  FormatAddCommas(val) { 
  2.              Result:=val 
  3.              StringLen, OutputVar, Result 
  4.              NumLoop := (OutputVar // 3) 
  5.              DNum = 3 
  6.              Loop, % (NumLoop+1) 
  7.              { 
  8.                 StringRight,Digit,Result,%DNum% 
  9.                 StringReplace, Result, Result, %Digit%,`,%Digit% 
  10.                 DNum += 4 
  11.              } 
  12.              StringLen, OutputVar, Result 
  13.              Loop, %OutputVar% 
  14.              { 
  15.                  FirstChar:=Substr(Result, 1, 1) 
  16.                  IfEqual, FirstChar, `, 
  17.                  { 
  18.                      Result:=Substr(Result, 2) 
  19.                  } else { 
  20.                      break 
  21.                  } 
  22.              } 
  23.              Return Result 
  24.          }