AHK v2 - Local Help file - Window Spy

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

AHK v2 - Local Help file - Window Spy

19 Dec 2018, 09:55

I do not know if these questions are in the right place on the AHK-forum.

I have now installed AHK-v2a on a computer.
But...

1. The local help file (.chm) does not work - (Opens but the info / text in the file is missing)
Which program is used for this help file? (or what is wrong?)

2. Window Spy that came with AHK-v2.0 also does not work.
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: AHK v2 - Local Help file - Window Spy

19 Dec 2018, 14:24

Hi,
I did not encounter those problems when using AHK v2, so the solutions may not work:
1) try https://www.quora.com/How-do-I-open-chm ... in-Windows
2) try using AHK_L to load the Window Spy Script
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

Re: AHK v2 - Local Help file - Window Spy

19 Dec 2018, 17:13

1) Thanks! (it works) :D

2) Is a special error… AHK-2.0 bug?
Remember
- First I removed all files from c:\Program files\Autohotkey\.
- Then I installed all AHK-v2 files in that directory.
- After that I pressed the Windows button and selected Autohotkey and clicked on the Icon Window Spy (Green - H) :mrgreen:
An POPUP-error was shown
Window name .: WindowSpy.ahk
Message .: Line Text: #NoEnv
Error: This line does not contain a recognized action.
The program will Exit


When I looked in the c:\Program files\Autohotkey\ directory,
I did not find a file named WindowsSpy.ahk

So when I clicked on the H Icon to an AHK-program as does not exist,
the Error message above was shown on the screen.
- Maybe the last Error from another ahk-test I did before...
Had in this case, expected the message "Could not find the program" or something like that.

Maybe this is an AHK-2.0 bug?
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: AHK v2 - Local Help file - Window Spy

19 Dec 2018, 20:08

AHK v2 doesn't come with Window Spy. When you removed everything in the AHK folder you probably also deleted Window Spy. I use Window Spy from v1. It is not a bug.
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

Re: AHK v2 - Local Help file - Window Spy

20 Dec 2018, 02:21

"Bug" as I see it - the shortcut has a path to a non existent file, and give a message .:
"Message .: Line Text: #NoEnv
...
Error: this line does not contain a recognized action...
"
Which line?
Which line Text? #NoEnv, in a missing file!
The entire program is missing!
The message made me think WindowSpy.ahk is not compatible with AHK-v2.0.
Had the message said WindowSpy.ahk is missing, I had made another interpretation.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: AHK v2 - Local Help file - Window Spy

20 Dec 2018, 03:05

Albireo, you are probably trying to run a v1 script (Window spy) with v2. It doesn't work, the first error being due to #NoEnv, which has been removed in v2.

Cheers :xmas:.
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

Re: AHK v2 - Local Help file - Window Spy

20 Dec 2018, 04:15

Helgef wrote:
20 Dec 2018, 03:05
...trying to run a v1 script (Window spy) with v2. It doesn't work, the first error being due to #NoEnv, which has been removed in v2....
Yes - I know!
Before clicking on the shortcut to WindowSpy.ahk (a non existent program, on this computer), I received that message when I tested an another AHK 1.1 program.
I do not expect the instruction to be wrong on a program, as is not exist on this computer … (all instructions is missing ;) )
coffee
Posts: 133
Joined: 01 Apr 2017, 07:55

Re: AHK v2 - Local Help file - Window Spy

21 Dec 2018, 10:50

Albireo wrote:
20 Dec 2018, 04:15

I do not expect the instruction to be wrong on a program, as is not exist on this computer … (all instructions is missing ;) )
The chm is fine. If it has blank contents, you have a problem with either file permissions, that specific file may require unblocking, internet permissions, or with the engine that windows uses to run the chms.

If you still have problem with the chm and need the manual offline, just download the entire github repo and open it with index.html
https://github.com/Lexikos/AutoHotkey_L-Docs/tree/v2
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AHK v2 - Local Help file - Window Spy

21 Dec 2018, 13:29

Another idea is to use 7-Zip to decompile the chm file to separate htm files. You can also decompile chm files by using C:\Windows\hh.exe via the command line, the default program that opens chm files.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

Re: AHK v2 - Local Help file - Window Spy

22 Dec 2018, 08:13

Thanks!

This solution - solved the problem using the .chm file
What I still think is wrong. (my point 2)
When I click on an icon that leads to a file (WindowSpy.ahk) that does not exist on this computer,
a message arises that it is an invalid instruction for AHK-2.0 (not the file is missing)
coffee
Posts: 133
Joined: 01 Apr 2017, 07:55

Re: AHK v2 - Local Help file - Window Spy

22 Dec 2018, 11:40

Albireo wrote:
22 Dec 2018, 08:13
Thanks!

This solution - solved the problem using the .chm file
What I still think is wrong. (my point 2)
When I click on an icon that leads to a file (WindowSpy.ahk) that does not exist on this computer,
a message arises that it is an invalid instruction for AHK-2.0 (not the file is missing)
Look at the files inside the v2 zip file. Do you see a windowspy.ahk in there? no, there isn't. So what's happening? you are using windowspy.ahk from v1, which is incompatible syntax with v2. There has never been a windowspy.ahk bundled with v2.
Why are you getting a message about invalid instruction and not about file missing? because syntax is checked first, then commands and expressions and all the other stuff are executed later.

Since it's lack-proactivity-week, grab the windowspy.ahk from the v1 folder (which is the only version to come with that file), compile it using ahk2exe from v1 (which is the only version to come with an ahk2exe.exe), using the autohotkeysc.bin from v1, grab the resulting exe, rename it to AU3_Spy.exe, place it in the same folder where your autohotkey v2 exe is. Now you can have your window spy for v2 since lexikos' v2 still looks for "au3_spy.exe".
Albireo
Posts: 1747
Joined: 16 Oct 2013, 13:53

Re: AHK v2 - Local Help file - Window Spy

23 Dec 2018, 08:49

The problem becomes more and more "puzzling", but feels that it is probably a Win10 hassle?...
(Back again) What I have done.

1. AHK-1.1 is installed on that computer.
2. Moved all the AHK-files from C:\Program Files\Autohotkey (But all AHK shortcuts etc. were left unchanged)
3. Unzipped all files, from the AHK-2.0.zip file to C:\Program Files\Autohotkey (No Problem)
Now I assume that AHK-2.0 is properly installed on this computer.
______
Tested some old AHK scripts, and got some minor errors ...
- Then I pressed on the Winkey
- Selected the program group .: Autohotkey
- After some tests (eg the Help file with its problems) I pressed the icon for "Window Spy"
Information for that Icon (and other Autohokey program) is available under C:\ProgramData\Microsoft\Start Menu\Programs\AutoHotkey
- Then I right clicked on the "Window Spy" shortcut and selecting the properties - which is c:\Program files\autohotkey\WindowSpy.ahkI'm sure this program doesn't exist, and have no explanation how Windows find WindowsSpy.ahk under another directory I have no idea why?

Is there an alternative to WindowsSpy for AHK 2.0?
coffee
Posts: 133
Joined: 01 Apr 2017, 07:55

Re: AHK v2 - Local Help file - Window Spy

23 Dec 2018, 12:55

Albireo wrote:
23 Dec 2018, 08:49

Now I assume that AHK-2.0 is properly installed on this computer.
It's not. Because you will then try to use it without adapting or changing anything. v2 is alpha, so it doesn't come with the same files as v1, since it is not "official".
Albireo wrote:
23 Dec 2018, 08:49
______
Tested some old AHK scripts, and got some minor errors ...
You can't do that since you can't guarantee that the syntax is v2 compatible, unless you are telling me the age of these "old scripts" is less than 6 months old.
v1 scripts are not fully compatible with v2, only a subset of v1 is compatible with v2.
Albireo wrote:
23 Dec 2018, 08:49
- Then I right clicked on the "Window Spy" shortcut and selecting the properties - which is c:\Program files\autohotkey\WindowSpy.ahkI'm sure this program doesn't exist, and have no explanation how Windows find WindowsSpy.ahk under another directory I have no idea why?

Is there an alternative to WindowsSpy for AHK 2.0?
I posted one alternative right in my previous post.
But here's an even easy one.

I need you to download the zip file from this link
https://autohotkey.com/download/
Where it says "Download AutoHotkey.zip" under the installer blue button and github mirror.

Unzip that to a subfolder in your desktop (any name you want). Rename AutoHotkeyU64.exe to AU3_Spy.exe (or you can use AutoHotkeyU32.exe if you are on 32bit machine), rename WindowSpy.ahk to AU3_Spy.ahk. Move these two files to the directory where you dropped the v2 files (if there's a WindowSpy.ahk where v2 files are, delete it). Delete the subfolder you created in the desktop.
oif2003
Posts: 214
Joined: 17 Oct 2018, 11:43
Contact:

Re: AHK v2 - Local Help file - Window Spy

23 Dec 2018, 13:03

coffee wrote:
23 Dec 2018, 12:55
That's pretty slick! I prefer this solution over compiling the script to exe, because it avoids the command prompt pop-up from batch files or the use of VBS, while keeping the script file easily accessible.

Also just to add, sometimes even old v2 scripts are not compatible with the current v2 build.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: iMPxNero, ositoMalvado, RussF, thqby and 33 guests