ListBuiltInVar_HTML() - list all built-in vars and their current values in html, with anchor links to AHK doc

Post your working scripts, libraries and tools for AHK v1.1 and older
20170201225639
Posts: 144
Joined: 01 Feb 2017, 22:57

ListBuiltInVar_HTML() - list all built-in vars and their current values in html, with anchor links to AHK doc

09 Oct 2018, 07:19

Image

Image




Code: Select all

<^q::
	ListBuiltInVar_HTML()
	{
		__1 := [ "A_Index", "A_Space", "A_Tab", "A_WorkingDir", "A_ScriptDir", "A_ScriptName", "A_YYYY", "A_MM", "A_DD", "A_Hour", "A_Min", "A_Sec", "A_IsSuspended", "A_BatchLines", "A_ListLines", "A_TitleMatchMode", "A_TimeIdle", "A_TimeIdlePhysical", "A_TimeIdleKeyboard", "A_TimeIdleMouse", "A_Gui", "A_GuiControl", "A_GuiEvent", "A_EventInfo", "A_ThisHotkey", "A_EndChar", "A_ThisMenuItem", "A_OSVersion", "A_ScreenWidth", "A_ScreenHeight", "A_Cursor", "A_CaretX", "A_CaretY", "A_Args", "A_ScriptFullPath", "A_ScriptHwnd", "A_LineNumber", "A_LineFile", "A_ThisFunc", "A_ThisLabel", "A_AhkVersion", "A_AhkPath", "A_IsUnicode", "A_IsCompiled", "A_ExitReason", "A_Year", "A_Mon", "A_MDay", "A_MMMM", "A_MMM", "A_DDDD", "A_DDD", "A_WDay", "A_YDay", "A_YWeek", "A_MSec", "A_Now", "A_NowUTC", "A_TickCount", "A_IsPaused", "A_IsCritical", "A_NumBatchLines", "A_TitleMatchModeSpeed", "A_DetectHiddenWindows", "A_DetectHiddenText", "A_AutoTrim", "A_StringCaseSense", "A_FileEncoding", "A_FormatInteger", "A_FormatFloat", "A_SendMode", "A_SendLevel", "A_StoreCapsLockMode", "A_KeyDelay", "A_KeyDuration", "A_KeyDelayPlay", "A_KeyDurationPlay", "A_WinDelay", "A_ControlDelay", "A_MouseDelay", "A_MouseDelayPlay", "A_DefaultMouseSpeed", "A_CoordModeToolTip", "A_CoordModePixel", "A_CoordModeMouse", "A_CoordModeCaret", "A_CoordModeMenu", "A_RegView", "A_IconHidden", "A_IconTip", "A_IconFile", "A_IconNumber", "A_DefaultGui", "A_DefaultListView", "A_DefaultTreeView", "A_GuiWidth", "A_GuiHeight", "A_GuiX", "A_GuiY", "A_GuiControlEvent", "A_ThisMenu", "A_ThisMenuItemPos", "A_PriorHotkey", "A_PriorKey", "A_TimeSinceThisHotkey", "A_TimeSincePriorHotkey", "A_ComSpec", "A_Temp", "A_OSType", "A_Is64bitOS", "A_PtrSize", "A_Language", "A_ComputerName", "A_UserName", "A_WinDir", "A_ProgramFiles", "A_AppData", "A_AppDataCommon", "A_Desktop", "A_DesktopCommon", "A_StartMenu", "A_StartMenuCommon", "A_Programs", "A_ProgramsCommon", "A_Startup", "A_StartupCommon", "A_MyDocuments", "A_IsAdmin", "A_ScreenDPI", "A_IPAddress1", "A_LastError", "A_LoopFileName", "A_LoopRegName", "A_LoopReadLine", "A_LoopField" ]
		__2 := {}
		for _,e in __1
		{
			__2[e] := %e%
		}
		
		_str := "<style>html,body { height:100%; } a {color:blue}  * {font-family:Courier New; font-size:14px} span {width:50%} iframe {position:absolute; top:0; left:50%; width:50%; height:100%;} </style>"
		_str .= "<span style='position:absolute; top:5; left:5; width:50%; height:100%; overflow:auto'><table 'style=display:inline''>"

		for i,e in __2
		{
			_anchor := RegExReplace(i, "^A_", "")
			_anchor := RegExReplace(_anchor, "^Caret.$", "Caret")
			_anchor := RegExReplace(_anchor, "^MouseDelay.+", "MouseDelay")
			_anchor := RegExReplace(_anchor, "^NumBatchLines$", "BatchLines")
			_anchor := RegExReplace(_anchor, "^CoordMode.+$", "CoordMode")
			_anchor := RegExReplace(_anchor, "^Loop.+$", "loop")
			_anchor := RegExReplace(_anchor, "^MDay", "DD")
			_anchor := RegExReplace(_anchor, "^Mon", "MM")
			_anchor := RegExReplace(_anchor, "^GuiHeight$", "GuiWidth")
			_anchor := RegExReplace(_anchor, "^Screen(Height|Width)$", "Screen")
			_url := "https://autohotkey.com/docs/Variables.htm#" . _anchor
			_str .= "<tr><td><a href=" _url " target=iframe_a>" i "</a></td><td>" e "</td></tr>" 
		}

		_str .= "</table></span>"

		_str .= "<iframe src='about:blank' name='iframe_a'></iframe>"

		_temp_file_path := A_Temp "\ListBuiltInVar_HTML.html"
		FileDelete, %_temp_file_path%
		FileAppend, %_str%, %_temp_file_path%
		Run % _temp_file_path
	}

burque505
Posts: 1735
Joined: 22 Jan 2017, 19:37

Re: ListBuiltInVar_HTML() - list all built-in vars and their current values in html, with anchor links to AHK doc

12 Oct 2018, 17:35

Very nice, helpful too. Thank you for sharing this.
Regards,
burque505

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 169 guests