Settimer limit Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
renArD
Posts: 36
Joined: 17 Feb 2020, 18:23

Re: Settimer limit

Post by renArD » 11 Mar 2020, 08:54

Telepathy works great, I had the idea while you was writing it :)
Thank you very much !

By the way I'm surprized the script can delete itself before it finishes. I guess it is loaded to RAM (any confirmation welcomed).

Please let me ask again if there is an other way to load a parallel thread without requiring creating and running a script file ?
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Settimer limit

Post by Hellbent » 11 Mar 2020, 09:02

@Rohwedder

I'm not familiar with ~.ahk .
I can only assume that the ~ has something to do with the currently running script?

To be honest, I'm actually too nervous to even run the script to find out because of the FileDelete, :lol:
Rohwedder
Posts: 7648
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Settimer limit

Post by Rohwedder » 11 Mar 2020, 10:01

~.ahk is just an arbitrary file name that I always use for this purpose.
Temporary file names often begin with a tilde, for example ~WRL0005.tmp.
If you use tmp.ahk instead, for example, it works the same way.
FileDelete, ~.ahk really only deletes the file ~.ahk.
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Settimer limit

Post by Hellbent » 11 Mar 2020, 10:10

@Rohwedder
Thank you.
Rohwedder
Posts: 7648
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Settimer limit

Post by Rohwedder » 11 Mar 2020, 11:02

@renArD
is there an other way to load a parallel thread without requiring creating and running a script file ?
Perhaps: AutoHotkey_H
https://hotkeyit.github.io/v2/
AutoHotkey_H adds functionality to original AutoHotkey and offers true multi-threading using NewThread() function or AutoHotkey.dll
renArD
Posts: 36
Joined: 17 Feb 2020, 18:23

Re: Settimer limit

Post by renArD » 11 Mar 2020, 16:46

Thanks for this suggestion !
I looks promising... and complicated too, mainly because it seams to rely on AHK v2 whereas I wrote my program for v1, which means many changes in syntax. Maybe I should go and translate/adapt everything and be meticulous.

Thanks again to all who helped with my initial case !
renArD
Posts: 36
Joined: 17 Feb 2020, 18:23

Re: Settimer limit

Post by renArD » 12 Mar 2020, 02:35

Thanks for your answer !
I may be wrong but it looks that NewThread() isn't available in v1 but in v2 only.
v1 : https hotkeyit.github.io /v1/docs/commands/ Broken Link for safety
v2 : https hotkeyit.github.io /v2/docs/commands/NewThread.htm Broken Link for safety
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Settimer limit

Post by HotKeyIt » 12 Mar 2020, 07:27

Correct, in v1 you have to use AhkThread, which uses AutoHotkey.dll from Resources or disk.
renArD
Posts: 36
Joined: 17 Feb 2020, 18:23

Re: Settimer limit

Post by renArD » 20 Oct 2021, 03:54

Hello,

Just to say that this solution worked :
Rohwedder wrote:
11 Mar 2020, 07:52
Or:

Code: Select all

title = Blabla
MsgBoxTitle = %title% - Confirmation
FileDelete, ~.ahk
FileAppend,
(
winwait, %MsgBoxTitle%,,1
controlSetText, Button1, This, %MsgBoxTitle%
controlSetText, Button2, That, %MsgBoxTitle%
controlSetText, Button3, Zout, %MsgBoxTitle%
), ~.ahk
Run, ~.ahk
MsgBox, 35,% MsgBoxTitle,blabla
However, it implies loading an ahk file, which seams to be possible only on computers that have AHK installed (because of the "Run, ~.ahk" instruction). I'm working on an other solution but any help will be appreciated.
renArD
Posts: 36
Joined: 17 Feb 2020, 18:23

Re: Settimer limit

Post by renArD » 20 Oct 2021, 07:08

Well, I managed to do the trick by creating an .exe file containing my function :

Code: Select all

#NoTrayIcon
MsgBox %1% - %2%
ExitApp
I integrate this .exe to my program :

Code: Select all

FileInstall, external.exe, %A_Temp%\external.exe, 1
Then I run the file with the parameters I wanted to give to my function.

Code: Select all

Run, %A_Temp%\external.exe "%param1%" "%param2%"
To clean up on close :

Code: Select all

OnExit("EndFunc")

EndFunc()
{
	Process, Close, external.exe ;In case it is still open
	FileDelete, %A_Temp%\external.exe ;Delete the external program, not to let dirts
}
I hope this can help someone
Post Reply

Return to “Ask for Help (v1)”