Yt-dlp & RunCommand

This is what I using for years. For download videos by yt-dlp.
I just changed theterminal.applescript in RunCommand.popclipext (11.1 KB)

(previous was youtube-dl)

tell application "Terminal"
	-- If there are no open windows, open one.
	if (count of windows) is less than 1 then
		do script ""
	end if
	set theTab to selected tab in first window
	do script "yt-dlp " & "{popclip text}" in theTab
end tell

.sh version (running without open Terminal) (12.1 KB)

1 Like

Thanks for sharing @kxxc, it’s a good example of how to wire up PopClip to your own scripts and utilities.

Of course we must first install the downloader with:

brew install yt-dlp

I had a look in the .sh version script to learn from it:

cd & yt-dlp $POPCLIP_TEXT &

My observations:

  • that the cd command changes directory to user home directory
  • The trailing & means that the command returns without blocking so PopClip will not “spin”

The effect is to download the video will download to home directory in the background

1 Like

I found the original .sh credit and thanks to him: