Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Program Cataloguer


  • Please log in to reply
10 replies to this topic
Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
This script shows statistics on the amount of scripts found on your computer. Here are my results:

Average size of source code: 6 KB
Total size of all source code: 1192 KB
Total number of programs: 190


And here is the code:

#NoEnv

ProgramExt = ahk

SplitPath, A_MyDocuments,, StartFolder
Gui, Font, S8 CDefault bold, Verdana
Gui, Add, Text, x2 y0 w230 h40 +Center, This program shows the total amount of programs you have written and their total sizes
Gui, Font, S8 CDefault norm, Verdana
Gui, Add, Text, x2 y50 w160 h20, Search for source code in:
Gui, Add, Radio, x2 y70 w100 h20 gShowInfo vShowInfo Checked, All Drives
Gui, Add, Radio, x2 y90 w100 h20 gShowInfo, Primary Drive
Gui, Add, Radio, x2 y110 w100 h20 gShowInfo, Custom Folder
Gui, Add, Text, x112 y80 w120 h40 vInfo
Gui, Add, Edit, x2 y130 w200 h20 vFolder +Disabled +ReadOnly, %StartFolder%
Gui, Add, Button, x202 y130 w30 h20 gSelectFile vSelectFile +Disabled, ...
Gui, Add, Button, x2 y160 w230 h20 +Default, Search
Gosub, ShowInfo
Gui, Show, w235 h185, Catalog Programs
Return

GuiEscape:
GuiClose:
ExitApp

ShowInfo:
Gui, Submit, NoHide
GuiControl,, Info, % ((ShowInfo = 1) ? "Search in all hard drives detected on this computer" : ((ShowInfo = 2) ? "Search only in the drive Windows is installed on" : "Manually select a folder to search"))
ShowInfo := (ShowInfo = 3)
GuiControl, Enable%ShowInfo%, Folder
GuiControl, Enable%ShowInfo%, SelectFile
Return

SelectFile:
FileSelectFolder, Folder, *%StartFolder%,, Please select a folder to search.
If ErrorLevel
 Return
GuiControl,, Folder, %Folder%
Return

ButtonSearch:
Gui, Submit
Folder := ((ShowInfo = 2) ? SubStr(A_WinDir,1,3) : ((ShowInfo = 3) ? Folder : ""))
If ShowInfo = 1
{
 DriveGet, Temp1, List, FIXED
 Loop, Parse, Temp1
  Folder .= A_LoopField . ":|"
 StringTrimRight, Folder, Folder, 1
}
Else If ShowInfo = 2
 SplitPath, A_WinDir,,,,, Folder
Else
{
 IfNotExist, %Folder%
 {
  MsgBox, 16, Error, Folder does not exist.
  ExitApp
 }
}
TrayTip, Search, Searching...
TotalSize = 0
ProgramCount = 0
SetBatchLines, -1
Loop, Parse, Folder, |
{
 Loop, %A_LoopField%\*.%ProgramExt%,, 1
 {
  AverageList .= A_LoopFileSize . "`n"
  ProgramCount ++
  TotalSize += A_LoopFileSize
 }
}
TrayTip
StringReplace, AverageList, AverageList, `n, `n, UseErrorLevel
Temp1 = %ErrorLevel%
StringTrimRight, AverageList, AverageList, 1
Loop, Parse, AverageList, `n
 Average += A_LoopField
Average /= Temp1 * 1024
TotalSize /= 1024

MsgBox, 64, Statistics, Average size of source code:%A_Tab%%Average% KB`nTotal size of all source code:%A_Tab%%TotalSize% KB`nTotal number of programs:%A_Tab%%ProgramCount%
ExitApp


MacroMan!
  • Members
  • 604 posts
  • Last active: Mar 20 2012 11:40 AM
  • Joined: 28 Aug 2009
Hmm, nice script.

Not many uses but is still quite interesting to see the info:

---------------------------
Statistics
---------------------------
Average size of source code: 10 KB
Total size of all source code: 921 KB
Total number of programs: 88
---------------------------
OK
---------------------------


What ever happened, happened.

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009

---------------------------
Statistics
---------------------------
Average size of source code: 8 KB
Total size of all source code: 5134 KB
Total number of programs: 596
---------------------------
OK
---------------------------

:wink:

SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006
Progress Bar starts at 100% and stays there until complete.

---------------------------
Statistics
---------------------------
Average size of source code: 15 KB
Total size of all source code: 108357 KB
Total number of programs: 7195
---------------------------
OK
---------------------------



Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

Progress Bar starts at 100% and stays there until complete.


Well, as you can see in the code, I have no way of determining the total number of *.ahk files before searching, and so am unable to calculate the percentage. The Progress was meant as more of a notification than an actual measure of progress.

Total size of all source code: 10835 KB


:shock: :shock: :shock: :shock: :shock:

That's over (assuming ANSI or UTF8) 10 million keystrokes!

SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006

Well, as you can see in the code, I have no way of determining the total number of *.ahk files before searching, and so am unable to calculate the percentage. The Progress was meant as more of a notification than an actual measure of progress.

My point, exactly...
Wouldn't a Splash (or some other notifier) serve the purpose without looking "broken?"

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Yes, I suppose it would. Original post has been updated.

SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006

Original post has been updated.

Great... Thanks.
Now the Tray Tip needs to go away when it's done searching instead of waiting for you to click 'OK' on the Statistics screen (exitApp).

Not many uses...

I can see potential uses for this.

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
Heres mine:

---------------------------
Statistics
---------------------------
Average size of source code: 10 KB
Total size of all source code: 3374 KB
Total number of programs: 326
---------------------------
OK
---------------------------


aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

visitor
  • Guests
  • Last active:
  • Joined: --
guys,
can someone of you help me doing a script which catalogs whole drives like specified here? > http://www.autohotke...ost-430618.html
the original poster attempted something but got nothing, and I am a complete newbie who is in the same boat looking for a simple tool which appears to not exist out there.
thnxs for listening.

Cataloguer
  • Guests
  • Last active:
  • Joined: --
Noticed your post when trying to find mine. Another user posted a working version which depending on your purpose may serve you well (and thanks for the idea on using it that way).