Page 1 of 1
Help file blocked
Posted: 08 May 2021, 00:58
by lexikos
@Alguimist
The included help file came up blank until I located the file in Explorer and "unblocked" it in the file's properties. This often occurs with the AutoHotkey zip downloads, and is likely to be a common occurrence for anyone downloading Adventure. I would suggest unblocking it automatically by deleting the "alternate stream" responsible for marking the file as originating from the Internet. For example:
Code: Select all
FileDelete, Help\AutoHotkey.chm:Zone.Identifier:$DATA
You can similarly read it with FileRead or IniRead, or view it with
notepad.exe "Help\AutoHotkey.chm:Zone.Identifier:$DATA" if you're curious about its contents.
Re: Help file blocked
Posted: 08 Jul 2021, 16:45
by Alguimist
@lexikos
Thanks! I added the following code to the function that opens the help file to remove the barricade metadata created by the native file extractor:
Code: Select all
Static s_bZone := True
If (s_bZone) {
FileRead ZoneId, %g_AhkHelpFile%:Zone.Identifier:$DATA
If (!ErrorLevel && ZoneId != "") {
FileDelete %g_AhkHelpFile%:Zone.Identifier:$DATA
}
s_bZone := False
}
Re: Help file blocked
Posted: 22 Feb 2023, 00:27
by Trubbleguy
I also had an issue with help opening in its own window everytime i pressed f1 and then when finished had to close 20-30 help windows so i added an IfWinExist statement to close the old one first
Code: Select all
OpenAhkHelpFile(HelpFile, Keyword) {
Static Zone := True
Local ZoneId, n, Pos, Extra, AhkHelpPath
If (Zone) {
FileRead ZoneId, %g_AhkHelpFile%:Zone.Identifier:$DATA
If (!ErrorLevel && ZoneId != "") {
; Remove barricade metadata added by native file extractor
FileDelete %g_AhkHelpFile%:Zone.Identifier:$DATA
}
Zone := False
}
n := TabEx.GetSel()
Pos := Sci[n].GetCurrentPos()
; "#" omitted from selection
If (Sci[n].GetCharAt(Sci[n].GetSelectionStart() - 1) == 35) {
Keyword := "#" . Keyword
} Else If (Keyword ~= "i)^(Hotkey|Progress|Edit)$" && (GetCurrentLine() ~= "i)^\s*Gui")) {
Extra := "GuiControl"
} Else If (Keyword = "Length" && (Sci[n].GetCharAt(Sci[n].WordEndPosition(Pos, True)) == 40)) {
Extra := "Object"
}
AhkHelpPath := A_ScriptDir . "\Tools\AhkHelp\AhkHelp." . (A_IsCompiled ? "exe" : "ahk")
ifwinexist,AutoHotkey Help
Winclose, AutoHotkey Help
RunEx(AhkHelpPath . " /helpfile " . HelpFile . " /keyword " . Keyword . " /extra " . Extra)
}