hotkey blocked or other idea

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

hotkey blocked or other idea

05 Nov 2023, 05:12

Hello

I have a rented program that I use for online Shop business. I have a problem at the packing station (where the packages are sent).

Information before: I tried Autokey Spy and the SAME ahk_class and ahk_exe are ALWAYS displayed (no matter in which window I am in this program and what I do). the code never changes.

no my Problem:
At the packing station my worker scan the barcode from the order.

A Member of this forum created me an autohotkey that automatically enters a word after 3 seconds after a barcode scan. "{#}AllesVerpacken{#}{Enter}"
After this the label with the adress from the client will be printet
This works in 95 % very very good

In a few cases( when we have shipping to an other country) a message box appears after 1 second (with the same ahk as everything). This information field says: "Ausland - WIEGEN"
because HERE we have to weight the parcel AFTER this the label with the adress from the client will be printet


BUT HERE the hotkey "{#}AllesVerpacken{#}{Enter}" makes problems for me. Because here it has to stop. And it will print the label without a right weight. Or a new window will get open with a button to push.


NOW I need ideas: what can I do?

1. Deactivate hotkey now?

or

2. Open an extra field where, for example, a button is pressed to confirm this manually (in the meantime the 3 seconds from the 1st hotkey have also run through and nothing has happened.


Then I need the hotkey like always.

I have no idea in which direction I should program something. What is even possible.

I hope you can somehow understand this.

THANK YOU Fiona

Here ist he hotkey a member maked for me

Code: Select all

#Requires AutoHotkey v2.0
#SingleInstance

MaxMilliseconds := 150
code_Entered := 0

:*CB0:UP:: {
	global
	code_Entered := 1
	SetTimer () => code_Entered := 0, -MaxMilliseconds
	return
}
; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ; ------------------------- ;

#HotIf (code_Entered)
~Enter:: {
	global
	Sleep(3000)
	Send("Hello{Enter}")
	return
}

[Mod edit: Moved the Codebox tags to be around the code. Please learn to correctly apply [code][/code] tags when posting code!]
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: hotkey blocked or other idea

05 Nov 2023, 05:22

Here is how you apply code tags to your forum posts when posting code:

add code tags.png
add code tags.png (14.11 KiB) Viewed 889 times

Please do this when posting code in the future. Thank you.
User avatar
Noitalommi_2
Posts: 332
Joined: 16 Aug 2023, 10:58

Re: hotkey blocked or other idea

05 Nov 2023, 23:22

Hi,

I don't understand the whole process you describe, but if your rented program opens a new window based on the scan result then it would make sense that your script evaluates the scan result before executing an action.
User avatar
Seven0528
Posts: 413
Joined: 23 Jan 2023, 04:52
Location: South Korea
Contact:

Re: hotkey blocked or other idea

06 Nov 2023, 00:03

 Okay, It may look like one question, but in reality, it's not just one question.
When dealing with a large and complex problem, it's important to break it down into smaller, more manageable parts.
For example, asking something like "How to detect when a window opens" and so on...

I can't fully understand the situation you're in, and most likely, others won't either.
However, I could roughly infer what it feels like, so I've listed some documents below that you can study.

BlockInput
Pause
Suspend
WinWait
WinWaitClose



If you provide more details, I will read them and, if there's any part where I can help, I'll leave a reply when I have the time.
  • English is not my native language. Please forgive any awkward expressions.
  • 영어는 제 모국어가 아닙니다. 어색한 표현이 있어도 양해해 주세요.
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

Re: hotkey blocked or other idea

06 Nov 2023, 06:27

Hello Again :-)


A Member of this forum created me an autohotkey. I make a Barcode Scan. After 3 seconds will be the words: "{#}AllesVerpacken{#}{Enter}"
This works very good ( the Autohotkey you see in my first question )

BUT: In a few cases( when we have shipping to an other country) a message box appears after 1 second (with the same ahk as everything). This information field says: "Ausland - WIEGEN"
because HERE we have to weight the parcel AFTER this the label with the adress from the client will be printet
BUT HERE the hotkey "{#}AllesVerpacken{#}{Enter}" makes problems for me. Because here it has to stop. And it will print the label without a right weight. Or a new window will get open with a button to push.

Information before: I tried Autokey Spy and the SAME ahk_class and ahk_exe are ALWAYS displayed (no matter in which window I am in this program and what I do). the code never changes.

My idea: to stopp he working hot key when this window will open ( woth the message: "Ausland - WIEGEN" . BBBUUUTTT i have no idea
because: I tried Autokey Spy and the SAME ahk_class and ahk_exe are ALWAYS displayed (no matter in which window I am in this program and what I do). the code never changes.



I hope you can somehow understand this.

THANK YOU Fiona
User avatar
WarlordAkamu67
Posts: 232
Joined: 21 Mar 2023, 06:52

Re: hotkey blocked or other idea

06 Nov 2023, 06:30

continued from

Everything is fine except that it fires all the time? Normally, the best option, you can change the "#HotIf (code_Entered)" to --> "#HotIf (code_Entered) && WinActive(window_Title)"; however, the window that pops up has the same EXE, Class, and everything... even the same title? Be sure to check the "Follow Mouse" box for the window spy and go over them. Do they have the same name? What about the control information? You can use this information to create a context sensitive hotkey by coding the checks into the "#HotIf" declaration. The name of the window is the name of the window in which you want the hotkey to activate, whatever window the code is scanned into.

If you can get rid of waiting 3 seconds and turn it into a "WinWait" that would optimize a bit as well.

If the window does not work, try to create context sensitive hotkeys by checking other conditions such as the control, window size, or however you have to cheese it. (make it work)
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

Re: hotkey blocked or other idea

06 Nov 2023, 08:31

@WarlordAkamu67
in Spy i took "follow Mouse" -> there is always the same: class, exe pid and id __ always in this programm. So i can´t work with the informations of different windows.
When the little window will be open, it looks like a push information. But really. The Spy says always the same.

So i can´t work with winwait or ?

The size is also a problem. We have different PC here and the size is always different :-(

Maybe its to difficult for a new autohotkeyer, like me :-(
But ... i really really need an idea..


Kind regards
Fiona
User avatar
WarlordAkamu67
Posts: 232
Joined: 21 Mar 2023, 06:52

Re: hotkey blocked or other idea

06 Nov 2023, 08:42

keyeyey1 wrote:
06 Nov 2023, 08:31
there is always the same: class, exe pid and id


And the same title?
windowtitle.PNG
windowtitle.PNG (8.06 KiB) Viewed 705 times
Sadly, if there is no condition to check against, there is no way to detect just that window in the program. Try providing screenshots with some more information and possibly somebody will see something workable.
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: hotkey blocked or other idea

06 Nov 2023, 08:58

@keyeyey1 — The most important thing is to answer WarlordAkamu67’s question about whether the titles of the windows are the same or not — you just keep saying that the ahk_class and ahk_exe are the same. If they happen to be, then notice that you can also distinguish windows by the “visible text” that is also revealed by Window Spy. Note the other parameters that are typical in the “Win…” functions — WinText and ExcludeText — like this for the WinExist function:
WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText)
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

Re: hotkey blocked or other idea

06 Nov 2023, 09:18

The title is always the same. It is always the name of the programm and the name of the user.
in ALL different pages i´m in the programm :-(
Attachments
Bild2.png
Bild2.png (1.1 MiB) Viewed 674 times
Bild1.png
Bild1.png (1.22 MiB) Viewed 674 times
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: hotkey blocked or other idea

06 Nov 2023, 12:28

OK, so did you look into the “Visible Text” as I suggested you do if that is the case?
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

Re: hotkey blocked or other idea

06 Nov 2023, 14:02

Hello:
Status Bar Text, Visible Text, All Text Control Under Mouse Positioin... all is empty
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: hotkey blocked or other idea

06 Nov 2023, 14:13

Another option to distinguish between windows is to get the size of each if they are unique in size.
User avatar
Noitalommi_2
Posts: 332
Joined: 16 Aug 2023, 10:58

Re: hotkey blocked or other idea

06 Nov 2023, 22:49

These are new pages in the EazyShipping program, maybe thats why WindowsSpy always shows the same Window results.
But there is an input field (Pickliste / Auftrag / Artikel) in the second picture, maybe it can be identified with WindowsSpy? (ClassNN: or Text:)
keyeyey1
Posts: 23
Joined: 29 Oct 2023, 17:37

Re: hotkey blocked or other idea

15 Nov 2023, 02:23

Hello again,

to "boiler": we work with different Laptop. So the Window size is not always the same :-(
And really the Spy is always the same for ALL pages in the programm.

It is a shipping programm from JTL. / Germany

A also asked them to help me, but they could´t ( or didn´t want ?)

i´m not a programmer --- but i´m sure that there must be a way .... because nothing is impossible an the Pc :-)

Kind regards

Fiona

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: kunkel321, shipaddicted, Spikea and 61 guests