I have a long list folders that i need to automatically spreadsheet the following two pieces of information into our existing excel document:
- Folder Name
- File count within that folder
I've written the script up to the point where i now need AHK to get the file count of the active explorer window, copy to clipboard and ALT+TAB/Paste it into the spreadsheet. I plan to loop this script using 'goto' and just monitoring it until it reaches the last folder and use ESC to end the script by eye.
Whats the easiest way to get the numerical value file count of the active window and have it copied to clipboard?
My code so far which is basically using F2 to 'rename' thus copy folder name, alt+tab to spreadsheet, paste it in, move to the file count cell on the spreadsheet, alt+tab back to active explorer window, step into said folder -- and now i'm stuck (where i need to get file count onto clipboard). It's worth noting that i would want the file count to ignore system files like .DS_Store if they're present.
`::
{
Send, {F2}
Sleep, 200
Send, {Ctrl Down}
Sleep, 50
Send, c
sleep, 50
Send, {Ctrl Up}
Sleep, 100
Send, {Alt Down}
Sleep, 50
Send, {Tab}
Sleep, 50
Send, {Alt Up}
Sleep, 100
Send, {Ctrl Down}
Sleep, 50
Send, v
sleep, 50
Send, {Ctrl Up}
Sleep, 100
Send, {Right}
Sleep, 50
Send, {Right}
Sleep, 50
Send, {Right}
Sleep, 100
Send, {Alt Down}
Sleep, 50
Send, {Tab}
Sleep, 50
Send, {Alt Up}
Sleep, 100
Send, {Enter}
^^^^^^^^^^^^^ Need my file count / copy to clipboard here
Esc::ExitApp
}