yxjxx
8/25/2016 - 10:41 AM

打开 iTerm 使用 you-get 下载 Chrome 当前 tab 页的视频

打开 iTerm 使用 you-get 下载 Chrome 当前 tab 页的视频

on alfred_script(q)
    -- your script here
    tell application "Google Chrome"
        -- 获取当前标签页的标题
        set tabname to get title of active tab of window 1
        -- 获取当前标签页的超链接地址
        set taburl to get URL of active tab of window 1
        tell application "iTerm"
            activate
            set the clipboard to "cd /Users/yxj/env3;source bin/activate;you-get " & taburl & ""
            delay 0.5
            tell application "System Events"
                keystroke "v" using command down
                keystroke return
            end tell
        end tell
        tell application "Google Chrome" to close active tab of window 1
        do shell script "echo " & tabname & " "
    end tell    
end alfred_script