I've developed several utility scripts over the past couple of months, and the one thing that I've found that's missing (at least I can't find it), and seems kind of basic, would be the ability to define the executable icon within the script itself... rather than having to use / change the settings within AHK2EXE each time.
To be clear, I'm already using the "Menu, Tray, Icon" option... I'm talking specifically about the icon defined for the executable. This would REALLY make it easy to work on multiple scripts, and then use the right-click compile option.
Of coruse, as has happened before, when I've tried to figure things out, I may be overlooking a simple solution, and, if so, I would be extremely appreciative for instructions.
Thanks to all that contribute to this amazing tool!!
Define the Executable Icon Within the Script
- RobbieWilkes
- Posts: 14
- Joined: 27 Feb 2018, 21:52
Re: Define the Executable Icon Within the Script
try using this comment at the top of the script:
not sure why these docs aren't listed anywhere:
http://fincs.ahk4.net/Ahk2ExeDirectives.htm
Code: Select all
;@Ahk2Exe-SetMainIcon [IcoFile]
http://fincs.ahk4.net/Ahk2ExeDirectives.htm
Re: Define the Executable Icon Within the Script
Those directives have not been implemented in the release branch of Ahk2Exe.
Re: Define the Executable Icon Within the Script
ahh sorry my mistake. i use them for AHK_H's Ahk2exelexikos wrote:Those directives have not been implemented in the release branch of Ahk2Exe.
- RobbieWilkes
- Posts: 14
- Joined: 27 Feb 2018, 21:52
Re: Define the Executable Icon Within the Script
I'm guessing that version of the compiler is not compatible with version 1.1.28.00?guest3456 wrote:ahh sorry my mistake. i use them for AHK_H's Ahk2exelexikos wrote:Those directives have not been implemented in the release branch of Ahk2Exe.
Is the AHK_H version a fork of the release version of AHK, or just a beta release?
Thanks again!
Re: Define the Executable Icon Within the Script
AHK_H is a fork of the normal AHK release, which adds new features. The compiler is also a fork with some added changes. Those directives that I linked were eventually supposed to make it into the normal AHK release, but I guess never did. HotKeyIt must've added them to the AHK_H compiler himselfRobbieWilkes wrote: I'm guessing that version of the compiler is not compatible with version 1.1.28.00?
Is the AHK_H version a fork of the release version of AHK, or just a beta release?
- RobbieWilkes
- Posts: 14
- Joined: 27 Feb 2018, 21:52
Re: Define the Executable Icon Within the Script
guest3456 wrote:AHK_H is a fork of the normal AHK release, which adds new features. The compiler is also a fork with some added changes. Those directives that I linked were eventually supposed to make it into the normal AHK release, but I guess never did. HotKeyIt must've added them to the AHK_H compiler himselfRobbieWilkes wrote: I'm guessing that version of the compiler is not compatible with version 1.1.28.00?
Is the AHK_H version a fork of the release version of AHK, or just a beta release?
Okay, I downloaded the ahkdll-v2-release-master.zip file, and I copied over the files in the Autohotkey folder. However, I noticed the there wasn't an actual replacement for the AHK2EXE.exe.
I tried adding the ;@Ahk2Exe-SetMainIcon [IcoFile] comment but I wasn't sure whether the name of the icon file was supposed to be inside the brackets or not, so I tried both ways.
;@Ahk2Exe-SetMainIcon [icons\YouTubeTV.ico]
;@Ahk2Exe-SetMainIcon icons\YouTubeTV.ico
I tried compiling using the right-click / compile, option, but with either of the comments, it still used the default AHK icon.
Am I misunderstanding how this is supposed to work?
Also, if I'm dragging this out in the wrong forum, and need to move it to the help forum, or to one dedicated to the Fork, please let me know. My thought is that, by asking here, I may be helping any others that are seeking the same answer.
Thanks!
Re: Define the Executable Icon Within the Script
If you wish to stick with the standard AHK 1.1, you can use Compile_AHK_II which will allow you to set an icon for the executable, and much much more.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
Re: Define the Executable Icon Within the Script
There was a beta for the compiler - you need that beta.
guest3456 probably replaced his compiler with that beta
see: https://autohotkey.com/boards/viewtopic.php?f=24&t=521
guest3456 probably replaced his compiler with that beta
see: https://autohotkey.com/boards/viewtopic.php?f=24&t=521
Recommends AHK Studio
Re: Define the Executable Icon Within the Script
So, I don't exactly know what the Right Click->Compile context menu item does. Thats a Windows shell extension, and I'm guessing that was installed by the normal AHK installation. So, that is probably looking to use the Ahk2Exe.exe executable in the AHK directory I'm assuming. In which case, you'd probably need to compile the AHK_H version of the Ahk2Exe.ahk script and then replace it.RobbieWilkes wrote: Okay, I downloaded the ahkdll-v2-release-master.zip file, and I copied over the files in the Autohotkey folder. However, I noticed the there wasn't an actual replacement for the AHK2EXE.exe.
...
I tried compiling using the right-click / compile, option, but with either of the comments, it still used the default AHK icon.
Ahhh. That explains it. Robbie, just use this then, then you don't need to use the AHK_H forknnnik wrote:There was a beta for the compiler - you need that beta.
see: https://autohotkey.com/boards/viewtopic.php?f=24&t=521
- RobbieWilkes
- Posts: 14
- Joined: 27 Feb 2018, 21:52
Re: Define the Executable Icon Within the Script
In reviewing my old posts, I realized that I didn't come back here and say THANKS to everyone for their help on this. It's working perfectly now.
Much appreciated!
Much appreciated!
Who is online
Users browsing this forum: No registered users and 54 guests