Make ahk run as exe

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Make ahk run as exe

03 Oct 2017, 17:50

While back someone posted a script that would make an ahk script run as an exe, no compile needed.
Now I wish to try it but cannot find it anywhere using any search terms.
Have any members have a link or the code?
kovacevica00
Posts: 51
Joined: 02 Oct 2017, 07:58

Re: Make ahk run as exe

03 Oct 2017, 17:54

Use SciTE4AutoHotkey program, its similar to notepad but it's made specially for AHK. From there you can run the script as EXE for testing.
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 18:02

Thx for reply but looking for for a script someone posted that would let an "AHK script run as an exe". Standalone not testing.
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 18:09

What do you mean with "make an ahk script run as an exe, no compile needed"?
That just doesn't make sense to me. Of course you can run AHK as an exe, but without compiling there is just no exe file to run. an ahk-file is just a text file, it cannot be executed without an interpreter like autohotkey.exe. That's why the ahk installer connects the ahk file extension with autohotkey.exe.

Perhaps you mean that you can rename a copy of Autohotkey.exe to the same name like your script and then run this renamed exe without actually compiling your .ahk-script: example.exe would then start example.ahk in the same folder...

Btw, compiling an ahk script just bundles together the script text file with autohotkey.exe in one file, anyway (and of course, include-files are added, too)
Last edited by gregster on 03 Oct 2017, 18:17, edited 1 time in total.
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 18:16

as mentioned someone wrote the code earlier, now looking for it. Not sure why u answered but do not have an answer.
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 18:17

You are not making sense. How do you run a text file? "Standalone" as you say... exe, but not compiled...?!?
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 18:27

I do not understand why u reply without an answer? If it don't make sense to you, don't answer with a non answer. Let someone else.
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 18:32

I just explained to you the options you have. If you would explain what your actual goal is, it would probably help "someone else", too, to help you. But running a pure text file without an interpreter in some form (or without compiling it) is like being a little bit pregnant... just doesn't happen.
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 18:37

plse do not reply, only looking for answers
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 18:40

Sure, but what is the question?
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 19:03

After being unable in AHK community, I found his elsewhere
I believe the coding was in "rename.ahk".

Extract:
NewName := A_ScriptName ;-- Grabs current script name (script.ahk)
StringTrimRight, NewName, NewName, 3 ;-- Removes the AHK extension
NewName .= "exe" ;-- Appends EXE extension
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 19:10

Well, that's a new definition of "standalone"... and exe-file, too.
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

03 Oct 2017, 19:15

And the answer is https://autohotkey.com/board/topic/3862 ... able-name/ by HotkeyIt.
Thx to gregster who egged me on so much I had to find it
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

03 Oct 2017, 19:20

Always happy to help. That's why I asked what you were actually trying to do...

btw, i mentioned the technique used here of running a script by renaming (a copy of) autohotkey.exe, above.
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

04 Oct 2017, 03:35

You answered a that question that not asked. You didn't read the question and jumped to a conclusion. No technique was asked or requested.
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

04 Oct 2017, 05:28

You found what you were looking for... so everything should be fine.

Just for clarification, because you still don't seem to realize: The link you provided doesn't show anything running "standalone" or "as an exe, no compile needed" . It just runs your ahk script (yes, the text file) by a (temporarily) renamed Autohotkey.exe so that you can see the script name in the task manager (instead of one or mulitiple instances of Autohotkey.exe, depending on how many scripts you are running at the same time) and better tell apart the processes of different running AHK scripts. You don't run your AHK script here as exe, at least not more or less than you would do without the provided function. You still need Autohotkey.exe to start the function call and also to temporarily rename it and then actually use it to run your script like you would always do (just done by the function call).

So, your provided answer was to a different question than you asked. I just pointed out that you were probably looking for something else and even hinted at the possibility to rename Autohotkey.exe, although not specifically mentioning the consequence that it would also rename the process (which shouldn't be surprising), because there was no clear indication what you were aiming at. Just don't shoot the messenger...
LarryC
Posts: 28
Joined: 30 Sep 2013, 12:14

Re: Make ahk run as exe

04 Oct 2017, 08:55

Your answer contained no "link"or "the code", as the question requested. Therefore you did not have the answer. You should have stayed out and let someone else answer. Instead you seen, something you could use to morph or hijack into something so you could show off your smarts.
gregster
Posts: 9003
Joined: 30 Sep 2013, 06:48

Re: Make ahk run as exe

04 Oct 2017, 09:06

Ohh, Don, it is you!!!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 268 guests