Unknown #includes appear in PMC exported AHK script sourcecode

Advanced Macro Recorder/Editor.

Moderator: Pulover

AzertyNL
Posts: 6
Joined: 02 Nov 2021, 10:19

Unknown #includes appear in PMC exported AHK script sourcecode

07 Jan 2022, 06:05

Suddenly (after making some trivial edits to an existing PMC macro I have been working on for a long time) there are #include statements added to the exported AHK script from PMC. These includes refer to files not available and consequently the script fails to run.

Anyone understands what might be going on here ???

This is the relevant part of the exported AHK script , note that the #includes are added just before the function which figures out the 'center' of an image (near the end of the generated script).
The first lines I show in the CODE segment below are the (expected) last lines of code from my own macros, the mysterious #includes appeared right after the end of my own code.

Code: Select all

........
    return countidle
}

#Include <Vis2> ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=36047
#Include <Vis2> ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=36047
#Include <Vis2> ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=36047

CenterImgSrchCoords(File, ByRef CoordX, ByRef CoordY)
{
........
AzertyNL
Posts: 6
Joined: 02 Nov 2021, 10:19

Re: Unknown #includes appear in PMC exported AHK script sourcecode

10 Jan 2022, 10:29

I'll be answering my own question, because I think I figured it out in the mean time.

The #include is generated as a result of using the "image to Text (OCR)" selection of the "Image / Pixel Search / Image to Text" Command. Once a PMC macro uses that OCR functionality, the #include will get generated as part of the exported AHK code.

It seems OCR requires some additional external file. Running such a macro within PMC functions as expected, but the export function creates an AHK script which will fail to run as the included file is not there. I have not found additional information on this in the documentation. Any pointers would be welcome.

On a related note:
It seems the 'Text to OCR' functionality always uses coordinates relative to the SCREEN, where as the Image search can be 'switched' to use coordinates relative both to SCREEN or WINDOW. This seeming limitation of the 'Text to OCR' functionality makes it less practical to use unfortunately. If anyone knows how to make 'Text to OCR' work based on WINDOW relative coordinates, please share how to do it.

Return to “Pulovers Macro Creator”

Who is online

Users browsing this forum: No registered users and 10 guests