@
exxfzc 给你 Workflow 也没用啊,每个安装情况不一样啊。我用的终端是 iTerm,下面是脚本:
on alfred_script(q)
if application "iTerm" is running or application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:
iTerm.app\"
activate
try
select first window
set onlywindow to false
on error
create window with default profile
select first window
set onlywindow to true
end try
tell the first window
tell current session to write text \"mpv \" & q
end tell
end tell
end run
" with parameters {q}
else
run script "
on run {q}
tell application \":Applications:
iTerm.app\"
activate
try
select first window
on error
create window with default profile
select first window
end try
tell the first window
tell current session to write text \"mpv \" & q
end tell
end tell
end run
" with parameters {q}
end if
end alfred_script
自己弄一个 workflow 吧,设置个快捷键,读取剪贴板内容。