Need help with this script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Need help with this script

04 Dec 2021, 09:35

Hello everybody. I've found this script on the internet and it doesn't work for me. It is not my script. The script is supposed to auto raise the hand once a Zoom meeting starts if the window of Zoom application is in focus. But it simply doesn't work for me no matter how many times I try it.
PS: My keyboard shortcut for raising/lowering the hand in Zoom app is the default one (Alt + Y). Any ideas why the following script doesn't work for me?

Code: Select all

SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


#IfWinExist Zoom Meeting 	; This detects if a window with a title like that exists and only works if it does 
PgUp:: 				; This is my preferred key 
WinActivate Zoom Meeting 	; Focuses to that window
Send, !y 			;Sends the shortcut that zoom has pre-configured for raising the hand (ALT+Y) 
return
[Mod edit: [code][/code] tags added.]
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Need help with this script

04 Dec 2021, 10:49

That script does not automatically do anything when the Zoom meeting window comes into focus, and it is not meant to do so. It only acts when you press the PgUp key. It simply allows you to press one key (PgUp) instead of the two-key combination to raise your hand, and it works whether the Zoom meeting window is in focus or not when the key is pressed.

A script could be written to do what you describe, but some more information would be needed. Would you want it to raise your hand every time that window comes into focus or just the first time after the Zoom meeting window comes into existence and then comes into focus?
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help with this script

04 Dec 2021, 11:22

Here is one idea, very basic.

Code: Select all

#SingleInstance Force
Loop {
 WinWaitActive, Zoom Meeting ahk_class ZPContentViewWndClass ahk_exe Zoom.exe
 Send !y ; Raise hand
 WinWaitClose
 SoundBeep, 1000
}
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

18 Dec 2021, 14:09

boiler wrote:
04 Dec 2021, 10:49
That script does not automatically do anything when the Zoom meeting window comes into focus, and it is not meant to do so. It only acts when you press the PgUp key. It simply allows you to press one key (PgUp) instead of the two-key combination to raise your hand, and it works whether the Zoom meeting window is in focus or not when the key is pressed.

A script could be written to do what you describe, but some more information would be needed. Would you want it to raise your hand every time that window comes into focus or just the first time after the Zoom meeting window comes into existence and then comes into focus?
Yeah, I'd need it for every time that window comes into focus and the meeting opens. I'd really appreciate such work so much if it can be made.
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

18 Dec 2021, 14:10

mikeyww wrote:
04 Dec 2021, 11:22
Here is one idea, very basic.

Code: Select all

#SingleInstance Force
Loop {
 WinWaitActive, Zoom Meeting ahk_class ZPContentViewWndClass ahk_exe Zoom.exe
 Send !y ; Raise hand
 WinWaitClose
 SoundBeep, 1000
}
Thanks for the answer but I don't know what this script is supposed to do, sorry. I've tried it and felt no difference.
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help with this script

18 Dec 2021, 14:23

When the window becomes active, it sends Alt+Y.
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Need help with this script

18 Dec 2021, 14:25

If it’s not doing that, try running it as administrator by right-clicking on the script file in File Explorer and selecting “Run as administrator.”
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help with this script

18 Dec 2021, 14:28

And: are you using the desktop Zoom program, rather than the Web site?
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

19 Dec 2021, 07:34

Yes, of course. I am running the desktop version, not the browser one. I did try running the script as the admin but it did not help, unfortunately. No hand inside the Zoom application is being risen automatically; I still have to do it manually by myself. I'm wondering what could be the problem... Appreciate the comments and help of you two gentlemen a lot.
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Need help with this script

19 Dec 2021, 08:20

When a Zoom meeting window exists, run the following code and see what it says:

Code: Select all

MsgBox, % WinExist("Zoom Meeting ahk_class ZPContentViewWndClass ahk_exe Zoom.exe") ? "Found" : "Not found"
If that doesn’t recognize the window, can you run the Window Spy tool that comes with AHK and post what it shows in the top section with the window title information for a Zoom meeting window? Perhaps yours is a little different than mikeyww’s.

Also, as a test, see if the following script allows you to raise your hand when you press the Tab key when a Zoom meeting window is active:

Code: Select all

Tab::Send, !y
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

20 Dec 2021, 11:25

This is what Window Spy tool says about my Zoom window:

Zoom Meeting
ahk_class ZPContentViewWndClass
ahk_exe Zoom.exe
ahk_pid 11296

I did try inserting the first command that you said and nothing happened.

As for the second command, yes, as you expected, I could raise my hand manually by using the Tab key afterwards.
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help with this script

20 Dec 2021, 12:21

Could try adding a sleep.

Code: Select all

#SingleInstance Force
Loop {
 WinWaitActive, Zoom Meeting ahk_class ZPContentViewWndClass ahk_exe Zoom.exe
 SoundBeep, 1500
 WinWaitClose, Join Audio ahk_class zJoinAudioWndClass ahk_exe Zoom.exe
 Sleep, 1000
 Send !y ; Raise hand
 SoundBeep, 2000
 WinWaitClose
 SoundBeep, 1000
}
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Need help with this script

20 Dec 2021, 12:58

TurBo wrote: I did try inserting the first command that you said and nothing happened.
How could nothing happen? It was meant to be executed as a stand-alone script, and it would have shown a MsgBox saying the window was either found or not found. You must have inserted into an existing script in a place where it never gets executed.

Based on the title information you posted, it should display “Found.” And since the hotkey worked, it probably is just a timing issue and mikeyww’s latest script is probably going to address that.
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

21 Dec 2021, 10:24

Okay, it was my bad. I did not know it should've been a stand-alone script. I did run that while the meeting window was there and it said "Found" in the little window that showed up.

As for this latest script from you, mikeyww, it made no difference unfortunately. No hand is being risen automatically once the meeting starts. It still has to be risen manually by pressing the shortcut (tried running the script as the admin and without it, it gives the same results).
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Need help with this script

21 Dec 2021, 10:31

If the window appears after the first Alt+Y but before the process itself has ended, then the key sequence will be sent again and will thus lower the hand.

You can post your exact script here.

One question is how many beeps you heard after the Zoom window appeared.
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

21 Dec 2021, 10:57

So how can I know if it happens?

My exact script is this:
Script.JPG
Script.JPG (57.75 KiB) Viewed 1225 times
And I hear no beeps at all once the Zoom window appears. Of course, all my sounds are turned up.
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

21 Dec 2021, 11:08

Okay people, so it seems that it had to be a stand-alone script. All this time I've been inserting this script from mikeyww in the mix with my other scripts. I do not understand why it didn't work because all of my scripts work as one AHK file. After trying to put this mikeyww's script as a separate AHK script, it finally works. And this is a first time that I hear the beeps you're talking about. Okay. It seems solved. I thank you so much gentlemen for your immense efforts. And I am sorry for inconvenience from my side although I don't understand why it doesn't work together with all my other scripts in one AHK file since all other scripts work just normally that way for me... But now I've figured out it has to be a separate script.

Thank you very much, gentlemen!
User avatar
boiler
Posts: 16925
Joined: 21 Dec 2014, 02:44

Re: Need help with this script

21 Dec 2021, 11:41

TurBo wrote: I do not understand why it didn't work because all of my scripts work as one AHK file.
Actually, you just saw an example of that not being the case when you added the MsgBox line to your existing script and I told you that you apparently added it where it would never execute.
User avatar
TurBo
Posts: 17
Joined: 06 Nov 2021, 15:15

Re: Need help with this script

21 Dec 2021, 13:36

That's true. Thank you, people. Although I don't have some knowledge of this scripting, I did learn some things today thanks to you two gentlemen. We learn as we live.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], mikeyww and 209 guests