request for script review
request for script review
Dear,
Would you please be so kind as to offer me some help?
I wrote the hereunder script first line in a notepad file named "Transparent AT-loop.ahk" (see attached printscreen). In the same folder, I placed the executable file (see same printscreen). To run the ahk file, I launch the exe file.
My problem is that when I change the letter in this first line (i.e. "s") and double-click anew on the exe file so that it takes my change into account, it doesn't.
(script:)
!s::
Best regards,
Philippe
Would you please be so kind as to offer me some help?
I wrote the hereunder script first line in a notepad file named "Transparent AT-loop.ahk" (see attached printscreen). In the same folder, I placed the executable file (see same printscreen). To run the ahk file, I launch the exe file.
My problem is that when I change the letter in this first line (i.e. "s") and double-click anew on the exe file so that it takes my change into account, it doesn't.
(script:)
!s::
Best regards,
Philippe
- Attachments
-
- image.png (101.99 KiB) Viewed 997 times
Re: request for script review
Changing the source code (.AHK) file does not automatically change the executable. If you double click the .AHK file, you will see your change take effect immediately, however, if you want to use the executable (.EXE), you must re-compile every time you make a change to your source.
Russ
Russ
Re: request for script review
Do you mean that you're changing the hotkey that is in your script? It should still work... Are you sure that you are saving the .ahk file, before re-running the .exe that is in the same folder?
Also, you don't have any #SingleInstance at the top... It is possible that the previous version is still in RAM? (right-click the icon in the system tray and choose Exit to kill it.)
EDIT: Also, like RussF said... If your exe file is merely a renamed version of "AutoHotkey.exe" then it will read from the same-name ahk file if there is one in the same folder. My above comment assumes that this is what you are doing.
However, if you've compiled your ahk into the exe that we see in the picture, then you'll need to recompile every time you edit the script.
Also, you don't have any #SingleInstance at the top... It is possible that the previous version is still in RAM? (right-click the icon in the system tray and choose Exit to kill it.)
EDIT: Also, like RussF said... If your exe file is merely a renamed version of "AutoHotkey.exe" then it will read from the same-name ahk file if there is one in the same folder. My above comment assumes that this is what you are doing.
However, if you've compiled your ahk into the exe that we see in the picture, then you'll need to recompile every time you edit the script.
ste(phen|ve) kunkel
Re: request for script review
Yes, you must save the .AKH file, but you must also re-compile for the changes to be reflected in the .EXE. Just saving WON'T do it.kunkel321 wrote: Are you sure that you are saving the .ahk file, before re-running the .exe that is in the same folder?
Russ
Re: request for script review
I believe this is only the case if/when the ahk has been compiled into an exe. If you just take a copy of AutoHotkey.exe and rename it to match one of the ahks in the same folder, the exe will read from the ahk at runtime. This is true for v1 and v2. This is how I run all of my own scripts. I haven't compiled any for years.
I suspect this is what Philippe is doing, given the file dates in his screenshot.
EDIT: See also:
https://www.autohotkey.com/docs/v2/Program.htm#portability
ste(phen|ve) kunkel
Re: request for script review
Thank you @kunkel321, I did not know that. Before I responded the last time, I checked the docs in both V1 and V2 under https://www.autohotkey.com/docs/v1/Program.htm#run - just to make sure I wasn't off base. I could not find anything there about the technique you mentioned. I just didn't scroll down far enough to the portability section.
Sooooooo, never mind what I said before, I have no idea why the changes in the script are not being reflected over and above what you have already mentioned.
Humbly, Russ
Sooooooo, never mind what I said before, I have no idea why the changes in the script are not being reflected over and above what you have already mentioned.
Humbly, Russ
Re: request for script review
Actually... As I look more closely at the script he posted, It shouldn't work at all.... (I think) it needs to be like:
Parentheses since it's a multi-line one... Also note that this is v1 code. (The Return might be redundant, not sure)
EDIT: No that's not right... Maybe this:
EDIT2: Or this:
Both are for v1
Code: Select all
!s::
(
Best regards, ; NOPE!
Philippe
)
Return
EDIT: No that's not right... Maybe this:
Code: Select all
!s::
Send, Best regards,`nPhilippe
Code: Select all
!s::
send,
(
Best regards,
Philipp
)
ste(phen|ve) kunkel
Re: request for script review
No, that doesn't work, but this does:
Russ
Code: Select all
!s::Send, `nBest regards,`nPhilippe`n
Re: request for script review
I was assuming that Philippe uses this little script to add his signature to emails (hence using "s"). It occurs to me now though, that he might have just been signing his name at the bottom of his forum post, and that it's not even part of his script... LOL
I guess that's a good reason to use the code boxes.
EDIT:
Anyway, I'm betting that he changed the ahk file but forgot to save the file to disc before re-running the exe. I've done that a million times.
I guess that's a good reason to use the code boxes.
EDIT:
Anyway, I'm betting that he changed the ahk file but forgot to save the file to disc before re-running the exe. I've done that a million times.
ste(phen|ve) kunkel
Re: request for script review
Hi friends
I'm reaching out to you because I still have a problem with my script, i.e. the loop I coded doesn't work
here is the script:
[Mod edit: [code][/code] tags added. Please use them yourself going forward.]
Can you help, please?
Kind regards,
I'm reaching out to you because I still have a problem with my script, i.e. the loop I coded doesn't work
here is the script:
Code: Select all
^!s::
wait := True
Loop {
Send ^a
Sleep 1000
Send ^x
Sleep 1000 }
Esc::ExitApp
Can you help, please?
Kind regards,
Re: request for script review
Sorry, but what you appear to be trying to do makes no sense.
What is the variable wait used for?
Why are you putting the rest of your code inside a loop? You can only select all (^a) and cut to clipboard (^x) once - and then there is nothing left to select or cut. Why are you putting it inside an endless loop?
Tell us what, exactly, it is that you want to accomplish.
Russ
What is the variable wait used for?
Why are you putting the rest of your code inside a loop? You can only select all (^a) and cut to clipboard (^x) once - and then there is nothing left to select or cut. Why are you putting it inside an endless loop?
Tell us what, exactly, it is that you want to accomplish.
Russ
Re: request for script review
thanks very much for replying!
Explaining everything would be long and unnecessary.
What I want to know is if the coding of the loop is correct whatever stands inside the loop.
Explaining everything would be long and unnecessary.
What I want to know is if the coding of the loop is correct whatever stands inside the loop.
Re: request for script review
Russ has a good point, that once you select-all, then cut, the text will be gone. But anyway... Make sure the closing } is on its own line. And be careful, because you have an endless loop.
ste(phen|ve) kunkel
Re: request for script review
Well, then I guess a detailed answer would be long and unnecessary as well. See Loop.Philog69 wrote:Explaining everything would be long and unnecessary.
Russ