Can someone please help me with this ghost?

The popular SciTE-based AutoHotkey Script Editor
User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Can someone please help me with this ghost?

28 Feb 2023, 05:20

Can someone please help me with this ghost?

I run this script below to use Alt + a to change the version of the AutoHotKey I’m working with. The code works as expected, however, when I run it at the end it pastes the last entry of the clipboard!!!!!

Code: Select all

!a::
Click, 367 62 ; clicks the icon to change the AutoHotKey version
Send {Down} ; goes down once
Send {Enter} ; sends enter to choose the default 
Return ; it finishes the code.
How on earth the last entry in my clipboard gets pasted?
I’ve made a new file only with this code (v2 file) and it works, yet I can't understand why the last entry of my clipboard gets pasted when the code runs in a v1 ahk file.
gregster
Posts: 9070
Joined: 30 Sep 2013, 06:48

Re: Can someone please help me with this ghost?

28 Feb 2023, 06:50

entropy wrote:
28 Feb 2023, 05:20

Code: Select all

!a::
Click, 367 62 ; clicks the icon to change the AutoHotKey version
Send {Down} ; goes down once
Send {Enter} ; sends enter to choose the default 
Return ; it finishes the code.
How on earth the last entry in my clipboard gets pasted?
I’ve made a new file only with this code (v2 file) and it works, yet I can't understand why the last entry of my clipboard gets pasted when the code runs in a v1 ahk file.
I can't really follow your problem description, and don't know what "when I run it at the end " means here. The end of what?
Also, the above posted code doesn't use v2 syntax, and would throw an error when ran with v2.
User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Can someone please help me with this ghost?

28 Feb 2023, 07:19

gregster wrote:
28 Feb 2023, 06:50
Also, the above posted code doesn't use v2 syntax, and would throw an error when ran with v2.
Thank you for replying gregster!
I’m in the process of converting my existing v1 ahk file to v2.
The above code is indeed a v1 script, however, it runs in a v1 file that is perfectly loaded.
gregster wrote:
28 Feb 2023, 06:50
Also, the above posted code doesn't use v2 syntax, and would throw an error when ran with v2.
When I’m editing this file and want to run it, my editor needs to be in v1 mode in order not to get the error when I run it. The script is for changing the mode of my editor from v2 to v1.

In my v2 file, I have this code that runs without problems:

Code: Select all

!a::
{
 Click 357, 14
 Send "{down}{down}{down}{down}{down}{down}"
 Send "{Enter}"
}
gregster wrote:
28 Feb 2023, 06:50
I can't really follow your problem description, and don't know what "when I run it at the end " means here. The end of what?
At the end means that after the script runs, all commands are being perfectly executed, however, "at the end" it pastes the last entry of my clipboard.
Imagine the code as it is with a last line after Send {Enter} that says: Send ^v

I hope it's more clear now! It is a ghost that I see it happening and can't understand it, let alone you that you read the explanation!
LAPIII
Posts: 669
Joined: 01 Aug 2021, 06:01

Re: Can someone please help me with this ghost?

05 Mar 2023, 12:01

I don't know what !a does in this editor.. It's not listed in the documentation under Keyboard commands. You can either override so what the hotkey does by putting a $ in front of it or Just use any other hotkey that doesn't interfere with the editors',
User avatar
entropy
Posts: 93
Joined: 17 Oct 2014, 01:45

Re: Can someone please help me with this ghost?

05 Mar 2023, 12:09

LAPIII wrote:
05 Mar 2023, 12:01
I don't know what !a does in this editor.. It's not listed in the documentation under Keyboard commands. You can either override so what the hotkey does by putting a $ in front of it or Just use any other hotkey that doesn't interfere with the editors',
!a is the hotkey that I assigned to the script.

But never mind I solved it by rewriting the script in v2

Return to “SciTE4AutoHotkey”

Who is online

Users browsing this forum: No registered users and 7 guests