Reload and Include Problem

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Reload and Include Problem

14 Oct 2014, 02:19

I got the same issue like him/her
https://www.reddit.com/r/AutoHotkey/com ... e_problem/

Snippet of my Code:

Code: Select all

#NoEnv
#SingleInstance Force
global flTextblocks := "F:\Test\TextBlocks\"
global flIncludes   := "F:\Test\TextBlocks\Includes.ini"

CreateInclude()
{
    File := FileOpen(flIncludes, "w", "UTF-8")
    loop, % flTextblocks "*.txt"
        File.WriteLine("#Include *i " A_LoopFileFullPath "`r`n")
    File.Close()
}

Include:
    #Include *i F:\Test\TextBlocks\Includes.ini
    #Include *i T:\hotstrings.txt
return

MenuReload:
    CreateInclude()
    Reload
return
Includes.ini

Code: Select all

#Include *i F:\Test\TextBlocks\Example01.txt
#Include *i F:\Test\TextBlocks\Example02.txt
The Include Files contains HotStrings



OT:
Problem with Codebox?
Image
Last edited by jNizM on 14 Oct 2014, 04:35, edited 2 times in total.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Guest

Re: Reload and Include Problem

14 Oct 2014, 02:29

Instead of using the Reload command have you tried running it instead Run myscript.ahk + using #SingleInstance, force ?
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Reload and Include Problem

14 Oct 2014, 02:50

#SingleInstance Force is always Present in my scripts...
I will try it with Run Programm.exe
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Reload and Include Problem

14 Oct 2014, 04:33

if the script runs uncompiled, reload does update the included files
if the script runs compiled, reload does not update the include files


Edit:
hmmm ok I see... Brain fail...
Is there a way to include files after I compile the script, so the includes can be updated everytime?
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
Contact:

Re: Reload and Include Problem

14 Oct 2014, 06:47

jNizM wrote:Is there a way to include files after I compile the script, so the includes can be updated everytime?
Not possible

Have you tried Run w/ /r or /restart switch?
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Reload and Include Problem

14 Oct 2014, 06:59

Reload and Run /restart is useless since the #Include File is included in the compiled exe

I need a Compiled-Portable-Exe and an include File for hotstrings. The Include-File can be updated.
e.g. (#Include hotstring.txt)

Code: Select all

::btw::by the way
::test::Test HotString
or any other possible way?!
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
Contact:

Re: Reload and Include Problem

14 Oct 2014, 07:15

Well, I don't think it's possible with compiled scripts. You can however, ship your script with Autohotkey.exe renamed to your_script.exe. Running the renamed exe will run your script as long as they're on the same directory
Guest

Re: Reload and Include Problem

15 Oct 2014, 04:15

You can simply parse hotstrings.txt using the various regex hotstrings functions that have been made (poly and mexinator) - that way you don't have to "include" them each time. Of course you'll end up with two files, your exe and the hotstrings.txt ... you can host your hotstrings.txt on dropbox for example, that way its still 'portable' and you can still have only one exe to take with you... just a thought.
RiRi Lopez

Re: Reload and Include Problem

26 Apr 2018, 16:51

jNizM wrote:Reload and Run /restart is useless since the #Include File is included in the compiled exe

I need a Compiled-Portable-Exe and an include File for hotstrings. The Include-File can be updated.
e.g. (#Include hotstring.txt)

Code: Select all

::btw::by the way
::test::Test HotString
or any other possible way?!
IF YOU EVER SOLVED THIS please let me know other user might need this sorry for the caps

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, Joey5, ShatterCoder, Xaucy and 191 guests