open url from clipboard in potplayer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

open url from clipboard in potplayer

24 Oct 2021, 07:27

ryt now my method involves
opening potplayer
press shortcut for opening window for inserting url (in my case its ctrl+z)
paste url
press enter

Code: Select all

Run C:\Program Files\DAUM\PotPlayer\PotPlayerMini64.exe
   WinWaitActive, PotPlayer ahk_class PotPlayer64
   Send, {LControl Down}
   Sleep, 47
   Send, {z}
   Send, {LControl Up}
   Sleep, 500
   Send, {Enter}
the main issue is tht if i open any another window in between the whole script ends up not working,,,i did read abt controlsend but had a hard time figuring it out
i was hoping somebody here can help me find a better way for executing this task
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: open url from clipboard in potplayer

24 Oct 2021, 09:30

You could just use the command line.

Code: Select all

Run, %ProgramFiles%\DAUM\PotPlayer\PotPlayerMini64.exe %Clipboard%
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: open url from clipboard in potplayer

24 Oct 2021, 10:24

this is exactly the kind of solution tht i was looking for ..thank you
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: open url from clipboard in potplayer

06 Dec 2021, 10:17

mikeyww wrote:
24 Oct 2021, 09:30
You could just use the command line.

Code: Select all

Run, %ProgramFiles%\DAUM\PotPlayer\PotPlayerMini64.exe %Clipboard%
sry for bringing this old post back up but wud it be possible to Controlsend keystrokes after getting the id of the window using winget??
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: open url from clipboard in potplayer

06 Dec 2021, 10:42

I don't know, but you could try it. Some windows respond to ControlSend. Others do not. I seem to remember earlier posts describing this. You might want to search for them (PotPlayer) to find examples.
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: open url from clipboard in potplayer

06 Dec 2021, 11:18

i did go through a few posts regarding this issueapparently using controlfocus and then followed by contolsend seems to be a solution..but i am not exactly sure how to retrieve the window id of the opened potplayer window(there are multiple potplayer windows open in the background)...i thot winget and subcommand myt be useful to get window id..but i dont think i really understand how to use it properly
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: open url from clipboard in potplayer

06 Dec 2021, 11:37

This worked for me.

Code: Select all

#IfWinExist ahk_class PotPlayer64 ahk_exe PotPlayerMini64.exe
F3::
ControlFocus
ControlSend,, {Space}
Return
#IfWinExist
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: open url from clipboard in potplayer

06 Dec 2021, 12:13

mikeyww wrote:
06 Dec 2021, 11:37
This worked for me.

Code: Select all

#IfWinExist ahk_class PotPlayer64 ahk_exe PotPlayerMini64.exe
F3::
ControlFocus
ControlSend,, {Space}
Return
#IfWinExist
this code works only if the potplayer window is the active one...i tried the following with controlfocus but it didnt do anything

Code: Select all

#IfWinExist ahk_class PotPlayer64 ahk_exe PotPlayerMini64.exe
F3::
ControlFocus,,ahk_class PotPlayer64 ahk_exe PotPlayerMini64.exe
ControlSend,, {Space}
Return
#IfWinExist
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: open url from clipboard in potplayer

06 Dec 2021, 12:17

Hmm. It worked here. I'm not sure what is up at your end. May be helpful: viewtopic.php?p=422059#p422059

Window Spy will show you the control name.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Holarctic, mapcarter, robnicholson and 346 guests