Youtube full window script not working [Solved]

Get help with using AutoHotkey and its commands and hotkeys
vahju
Posts: 27
Joined: 30 Sep 2013, 16:09

Youtube full window script not working [Solved]

07 Mar 2014, 11:02

For what ever reason I cannot get the below code to work in Chrome 33 and IE 11. The cursor goes to the URL field, highlights the URL, but the data never makes it to the clipboard for the stringreplace to work.

Now I was able to test this with a text file and the stringreplace worked just fine.
Goal is to take a youtube video URL
http://www.youtube.com/watch?v=aNiYIYR0UPM
And change it to this:
http://www.youtube.com/v/aNiYIYR0UPM

Running Window 7 with ahkl 1.1.14.02 with no other scripts running.

I prefer watching videos full windows vs full screen so I can see the task bar/window notifications.

Code: Select all

ScrollLock::
	Clipboard :=
	Send, !d
	;Send, ^a
	Send, ^c
	Sleep, 200
	StringReplace, Clipboard, Clipboard, watch?v=, v/, All
	Sleep, 200
	;Send, {end}{enter}
	Send, ^v{enter}
return
Found this youtube tip at Lifehacker.
Last edited by vahju on 07 Mar 2014, 15:18, edited 1 time in total.
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: Youtube full window script not working

07 Mar 2014, 14:24

You need to add a delay(Sleep 200) between the !d and ^c sends.
vahju
Posts: 27
Joined: 30 Sep 2013, 16:09

Re: Youtube full window script not working

07 Mar 2014, 15:18

I can't believe I missed that. I put sleep every else but there.

Thanks for you help and below is the working code.

Code: Select all

ScrollLock::
	Clipboard :=
	Send, !d
	Sleep, 200
	Send, ^c
	Sleep, 200
	StringReplace, Clipboard, Clipboard, watch?v=, v/, All
	Sleep, 200
	Send, ^v{enter}
return

Return to “Ask For Help”

Who is online

Users browsing this forum: bautai, punchin, sobuj53, TAC109, Xeo786 and 35 guests