Last active
October 10, 2015 15:05
-
-
Save robertgzr/537313625160975cb11a to your computer and use it in GitHub Desktop.
Play clipboard conent with mpv (using iTerm) - AppleScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mpv_command to ("mpv " & "'" & (the clipboard as text) & "'") | |
tell application "iTerm" | |
activate | |
tell first window | |
if (count of tabs) is greater than 1 then | |
tell last tab | |
tell current session | |
set name to "autompv" | |
if (is processing) then | |
write text "q" | |
end if | |
delay (0.2) | |
write text "clear" | |
write text mpv_command | |
end tell | |
end tell | |
else | |
set newTab to (create tab with default profile) | |
tell newTab | |
tell current session | |
set name to "autompv" | |
write text mpv_command | |
end tell | |
end tell | |
end if | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment