Needing help with script please

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Renee88
Posts: 29
Joined: 15 Dec 2022, 22:10

Needing help with script please

10 May 2024, 11:05

Okay first of all here is what I'm trying to do:

I want to scroll down with 11 down arrow key presses and then left click a specific location on the site to play the media and then once the media starts I would like to pause and wait until fully loaded. And I would also like to be able to press !p while in the open tab which is a hotkey I setup on firefox for a addon to start.

So here is what I have so far:

Code: Select all

+P::
Send {Down 11}
Sleep 200
Click 335, 465
Sleep 200
Click 335, 465
Sleep 200
Send !p
Return
But something keeps going wrong I keep getting the media player opening in full screen and not just playing on the current window. I want to just keep it inside the website window and then move back to what I was doing until the video loads.These videos are only a few minutes each so I will close the tab once the video is down.

So I want to go down 11 and click on the video player until it starts to load and then once it has loaded which sometimes takes a few seconds I will then pause the video and press a hotkey which is alt+p which activates the addon. alt+p works fine on its own but wont work in the script. I just tried it on the window media player and if I double click really fast with the mouse the full screen media player opens every time. So I just want to click it and then leave the window.

I might not need the sleeps but I don't know how else to click twice while waiting for the video to start loading. So I just used sleep so down works but click opens full screen media player maybe its clicking to fast I'm not sure.

I have also changed the code to this to try and close the full screen

Code: Select all

+P::
Send {Down 11}
Sleep 200
Click 335, 465
Sleep 200
Click 335, 465
Sleep 200
Send {ESC}
Sleep 150
Send !p
Return
If I can figure out the issue that keep opening full screen I wont need the Send esc. But this is how far I have gotten.
peter_ahk
Posts: 123
Joined: 13 Feb 2024, 14:49

Re: Needing help with script please

11 May 2024, 21:49

when you leave a window the window no longer has focus so it is just sending to where? you need a winactivate somewhere i am guesing and controlclick could possibly be your friend vs these clicks on the screen not sure hard to say as i dont know your target program. but the way you have this it just always does this i would set it up to be confined to your specific window so that it does not try to do this on whatever window has your focus
Renee88
Posts: 29
Joined: 15 Dec 2022, 22:10

Re: Needing help with script please

16 May 2024, 14:20

The window is actually the Firefox Program.

Return to “Ask for Help (v1)”

Who is online

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