Help file blocked

Open source general-purpose IDE, lightweight text editor. Previously known as AutoGUI.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Help file blocked

Post by lexikos » 08 May 2021, 00:58

@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.

User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Help file blocked

Post by Alguimist » 08 Jul 2021, 16:45

@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
}

User avatar
Trubbleguy
Posts: 18
Joined: 11 Jul 2014, 03:00

Re: Help file blocked

Post by Trubbleguy » 22 Feb 2023, 00:27

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)
}

Post Reply

Return to “Adventure IDE”