Created
September 17, 2012 01:47
-
-
Save rjungemann/3735143 to your computer and use it in GitHub Desktop.
Text to and from system clipboard to tmux using 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
-- putting current selection in clipboard | |
-- set tmux path | |
set tmux_path to "/usr/local/bin/tmux" | |
-- copy selected text to clipboard | |
tell application "System Events" to keystroke "c" using {command down} | |
delay 0.1 -- so copy can take place | |
set selected_text to (the clipboard as text) | |
-- give tmux the text from the clipboard | |
do shell script "pbpaste | " & tmux_path & " load-buffer -" | |
-- paste from tmux | |
-- set tmux path | |
set tmux_path to "/usr/local/bin/tmux" | |
do shell script tmux_path & " save-buffer - | pbcopy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment