;Select youtube videos with clipboard to create a playlist. Use CTRL +Y when finished. ;created by cects.com 9/19/2015. Updated 4/10/2020. ;Below allows script to start with clipboard empty clipboard = ; Empty the clipboard ;User help when hovering over icon in system tray TrayTip, YouTube Playlist, Use clipboard to select videos `nCTRL + Y when done selecting videos `nCTRL + Z Exits script `nCTRL + ALT + C Clears the clipboard, 1 menu, tray, tip, Use clipboard to select videos `nCTRL + Y when done selecting videos `nCTRL + Z Exits script `nCTRL + ALT + C Clears clipboard ;Define playlist string playlist = http://www.youtube.com/watch_videos?video_ids= #Persistent OnClipboardChange("ClipChanged") return ClipChanged(Type) { if clipboard contains youtube.com/watch,youtube.com/embed/,youtu.be { StringRight, clipboard, clipboard, 11 ; Removes all but last 11 characters gosub, doit return } return } doit: count++ playlist = %playlist%%clipboard%, TrayTip, Current Playlist:, %playlist% `nNumber of Videos: %count%`nUse CTRL + Y when done selecting videos ... Sleep 6000 TrayTip ; Turn off the tip. return ^y:: ;Remove last comma, display playlist, and copy playlist to clipboard StringTrimRight, playlist2, playlist, 1 ;Replace last comma with blank (also converts the clipboard to plain text). clipboard = %playlist2% ;Turn off OnClipboardChange OnClipboardChange("ClipChanged", 0) Msgbox, 0, YouTube Playlist, Number of Videos in playlist: %count% `n`n%playlist2% `n`nAbove playlist copied to clipboard `n`nUse CTRL + Z to exit or CTRL + ALT + C to clear the clipboard ... ;Turn OnClipboardChange on again (necessary to keep Clipboard from aquiring playlist2) OnClipboardChange("ClipChanged", 1) return ; Ctrl + ALT + C : Clear clipboard ^!c:: MsgBox, 0, YouTube Playlist - Clipboard cleared, Number of cleared videos in playlist: %count% `n`n`nClipboard cleared. clipboard = playlist = http://www.youtube.com/watch_videos?video_ids= count = return ^z:: ExitApp