This is what I using for years. For download videos by yt-dlp.
I just changed theterminal.applescript in RunCommand.popclipext RunCommand.popclipext.zip (11.1 KB)
(previous was youtube-dl)
tell application "Terminal"
activate
-- 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
#popclip
name: Yt-dlp
icon: iconify:solar:download-bold-duotone
requirements: ["urls"]
actions:
- title: Yt-dlp
language: AppleScript
applescript: |
tell application "iTerm"
activate
if (count of windows) = 0 then
create window with default profile
end if
tell current window
set newTab to create tab with default profile
tell current session of newTab
write text "yt-dlp " & "{popclip text}" & " ; osascript -e 'display notification \"Done\" with title \"Yt-dlp\"'"
end tell
end tell
end tell
Terminal
#popclip
name: Yt-dlp
icon: iconify:solar:download-bold-duotone
requirements: ["urls"]
actions:
- title: Yt-dlp
language: AppleScript
applescript: |
tell application "Terminal"
activate
if (count of windows) = 0 then
do script ""
end if
do script "yt-dlp {popclip text} ; osascript -e 'display notification \"Done\" with title \"Yt-dlp\"'" in front window
end tell