Code: Select all
; NAME: ExtractSortedFunctionList.v2.ahk
; DESCRIPTION: Strips functions from ahk program code and save it to a file.
; NOTE: Change FullPath, FileIn, and FileOut then execute
;=============================================================================
#Requires AutoHotkey >=2.0-<2.1
#SingleInstance Force ; Recommended so only one copy is runnnig at a time
SetWorkingDir A_ScriptDir ; Ensures a consistent starting directory.
FullPath := "D:\_AHK2\___SCRIPTS\GDIP\Buliasz_AHKv2-Gdip-master\"
FileIn := "Gdip_All_184.v2.ahk"
FileOut := "Gdip_All_184_SortedFunctionList.v2.txt"
FileInFP := FullPath . FileIn
FileOutFP := FullPath . FileOut
{
ExtractSortedFunctionList(FileInFP,FileOutFP)
ExitApp
}
ExtractSortedFunctionList(FIFP,FOFP)
{
StrIn := FileRead(FIFP)
while ((PosSemi := InStr(StrIn,";")) > 0)
{
PosCR := InStr(StrIn,"`n",0,(PosSemi+1))
StrIn := SubStr(StrIn,1,(PosSemi-1)) . SubStr(StrIn,(PosCR+1))
}
StrIn := StrReplace(StrIn,"`r`n","`n")
StrIn := StrReplace(StrIn,"`n`n","`n")
while ((PosCB := InStr(StrIn,"}")) > 0)
{
PosOB := InStr(StrIn,"{",0,-(StrLen(StrIn) - PosCB+1))
StrIn := SubStr(StrIn,1,(PosOB-1)) . SubStr(StrIn,(PosCB+1))
}
StrIn := StrReplace(StrIn,"`n`n","`n")
StrIn := StrReplace(StrIn,"`n`n","`n")
StrIn := Sort(StrIn)
if(FileExist(FOFP))
{
FileDelete FOFP
}
FileAppend StrIn, FOFP
ExitApp
}
Esc::
{
ExitApp
Return
}