Skip to content

Instantly share code, notes, and snippets.

@yxjxx
Created August 25, 2016 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yxjxx/7cca8559bfb08d805e60a7d1d02f8183 to your computer and use it in GitHub Desktop.
Save yxjxx/7cca8559bfb08d805e60a7d1d02f8183 to your computer and use it in GitHub Desktop.
打开 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment