Monday, September 16, 2019

#1 2019-08-09 02:27:15 pm

LuckBox
Member
Registered: 2007-03-24
Posts: 11

Get URL from Chrome, run command in terminal

I am trying to get the URL from the active tab in Chrome, Open terminal, and then run the youtube-dl command with the received URL.  This is what I have so far:


tell application "Google Chrome"
    set bigURL to the URL of active tab of window 1
end tell
tell application "Terminal"
    activate
    do script "youtube-dl -f best" - bigURL
    return input
end tell


it does not work however.  Any suggestions?

Offline

 

#2 2019-08-09 02:42:29 pm

LuckBox
Member
Registered: 2007-03-24
Posts: 11

Re: Get URL from Chrome, run command in terminal

I think I solved the issue with:

tell application "Google Chrome"
    set bigURL to the URL of active tab of window 1
end tell
tell application "Terminal"
    activate
    do script "youtube-dl -f best " & bigURL
    return input
end tell

Offline

 

#3 2019-08-22 08:55:41 am

bogdanw
Member
Registered: 2019-07-13
Posts: 13

Re: Get URL from Chrome, run command in terminal

You can use

Applescript:

do shell script "/usr/local/bin/youtube-dl --no-check-certificate -f best " & bigURL

instead of tell application "Terminal"

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)